tests/NuGetGallery.FunctionalTests/ErrorHandling/ErrorHandlingTests.cs
/// <summary>
/// Verify a matched route but a mismatched HTTP method.
/// </summary>
Verify a matched route but a mismatched HTTP method.
Verify a matched route but a mismatched HTTP method .
[Theory]
        [Priority(2)]
        [Category("P2Tests")]
        [InlineData("DELETE", "/api/v2", 405)]
        [InlineData("DELETE", "/api/status", 500)]
        [InlineData("GET", "/packages/manage/reflow", 404)]
        [InlineData("POST", "/packages/BaseTestPackage/1.0.0/License", 404)]
        public async Task UnsupportedMethod(string httpMethod, string relativePath, int statusCode)
        {
            var response = await GetTestResponseAsync(new HttpMethod(httpMethod), relativePath);
            Assert.Equal((HttpStatusCode)statusCode, response.StatusCode);
        }
[ Theory ] [ Priority ( 2 ) ] [ Category ( " " ) ] [ InlineData ( " " , " " , 405 ) ] [ InlineData ( " " , " " , 500 ) ] [ InlineData ( " " , " " , 404 ) ] [ InlineData ( " " , " " , 404 ) ] public async Task UnsupportedMethod ( string httpMethod , string relativePath , int statusCode ) { var response = await GetTestResponseAsync ( new HttpMethod ( httpMethod ) , relativePath ) ; Assert . Equal ( ( HttpStatusCode ) statusCode , response . StatusCode ) ; }
Verify a matched route but a mismatched HTTP method.
Verify a matched route but a mismatched HTTP method .
// The following have non-ideal behavior. // Arrange & Act // Assert
httpMethod
string
relativePath
string
statusCode
int