@@ -389,61 +389,4 @@ public async Task SkipStatusCodePages_WorksIfUsedBeforeRouting()
389389
390390 Assert . Equal ( "Status: 400" , content ) ;
391391 }
392-
393- [ Fact ]
394- public async Task CreateScopeForStatusCodePages_DefaultParameterWorks ( )
395- {
396- var expectedStatusCode = 432 ;
397- var destination = "/location" ;
398-
399- using var host = new HostBuilder ( )
400- . ConfigureWebHost ( webHostBuilder =>
401- {
402- webHostBuilder
403- . UseTestServer ( )
404- . Configure ( app =>
405- {
406- // Use the new overload with default parameter
407- app . UseStatusCodePagesWithReExecute ( pathFormat : "/errorPage" ) ;
408-
409- app . Map ( destination , ( innerAppBuilder ) =>
410- {
411- innerAppBuilder . Run ( ( httpContext ) =>
412- {
413- httpContext . Response . StatusCode = expectedStatusCode ;
414- return Task . FromResult ( 1 ) ;
415- } ) ;
416- } ) ;
417-
418- app . Map ( "/errorPage" , ( innerAppBuilder ) =>
419- {
420- innerAppBuilder . Run ( ( httpContext ) =>
421- {
422- return httpContext . Response . WriteAsync ( "Error page" ) ;
423- } ) ;
424- } ) ;
425-
426- app . Run ( ( context ) =>
427- {
428- throw new InvalidOperationException ( "Invalid input provided." ) ;
429- } ) ;
430- } ) ;
431- } ) . Build ( ) ;
432-
433- await host . StartAsync ( ) ;
434-
435- using var server = host . GetTestServer ( ) ;
436- var client = server . CreateClient ( ) ;
437- var response = await client . GetAsync ( destination ) ;
438- var content = await response . Content . ReadAsStringAsync ( ) ;
439-
440- Assert . Equal ( "Error page" , content ) ;
441- }
442-
443- [ Fact ]
444- public void StatusCodePagesOptions_CreateScopeForStatusCodePages_DefaultValue ( )
445- {
446- var options = new StatusCodePagesOptions ( ) ;
447- Assert . False ( options . CreateScopeForStatusCodePages ) ;
448- }
449392}
0 commit comments