tests/NuGetGallery.FunctionalTests/ErrorHandling/ErrorHandlingTests.cs
/// <summary>
/// Simulate cases where application code throws different sorts of exceptions.
/// </summary>
Simulate cases where application code throws different sorts of exceptions.
Simulate cases where application code throws different sorts of exceptions .
[Theory]
        [Priority(2)]
        [Category("P2Tests")]
        [MemberData(nameof(AllTestData))]
        public async Task SimulateError(EndpointType endpointType, SimulatedErrorType simulatedErrorType)
        {
            var request = new SimulatedErrorRequest(endpointType, simulatedErrorType);
            var response = await GetTestResponseAsync(request);
            if (!ExpectedSimulatedErrorResponses.TryGetValue(request, out var validator))
            {
                validator = Validator.PrettyInternalServerError();
            }
            validator(response);
        }
[ Theory ] [ Priority ( 2 ) ] [ Category ( " " ) ] [ MemberData ( nameof ( AllTestData ) ) ] public async Task SimulateError ( EndpointType endpointType , SimulatedErrorType simulatedErrorType ) { var request = new SimulatedErrorRequest ( endpointType , simulatedErrorType ) ; var response = await GetTestResponseAsync ( request ) ; if ( ! ExpectedSimulatedErrorResponses . TryGetValue ( request , out var validator ) ) { validator = Validator . PrettyInternalServerError ( ) ; } validator ( response ) ; }
Simulate cases where application code throws different sorts of exceptions.
Simulate cases where application code throws different sorts of exceptions .
// Arrange // Act // Assert
endpointType
EndpointType
simulatedErrorType
SimulatedErrorType