99namespace Swashbuckle . AspNetCore . IntegrationTests
1010{
1111 [ Collection ( "TestSite" ) ]
12- public partial class SwaggerVerifyIntegrationTest
12+ public partial class VerifyTests
1313 {
1414 [ Theory ]
1515 [ InlineData ( typeof ( Basic . Startup ) , "/swagger/v1/swagger.json" ) ]
@@ -36,6 +36,7 @@ public async Task SwaggerEndpoint_ReturnsValidSwaggerJson(
3636 var swagger = await swaggerResponse . Content . ReadAsStringAsync ( ) ;
3737
3838 await Verifier . Verify ( NormalizeLineBreaks ( swagger ) )
39+ . UseDirectory ( "snapshots" )
3940 . UseParameters ( startupType , GetVersion ( swaggerRequestUri ) )
4041 . UniqueForTargetFrameworkAndVersion ( ) ;
4142 }
@@ -51,7 +52,9 @@ public async Task SwaggerEndpoint_ReturnsValidSwaggerJson_ForAutofaq()
5152
5253 using var swaggerResponse = await client . GetAsync ( swaggerRequestUri ) ;
5354 var swagger = await swaggerResponse . Content . ReadAsStringAsync ( ) ;
55+
5456 await Verifier . Verify ( swagger )
57+ . UseDirectory ( "snapshots" )
5558 . UseParameters ( startupType , GetVersion ( swaggerRequestUri ) )
5659 . UniqueForTargetFrameworkAndVersion ( ) ;
5760 }
@@ -67,7 +70,9 @@ public async Task Swagger_IsValidJson_No_Startup(
6770 string swaggerRequestUri )
6871 {
6972 var swaggerResponse = await SwaggerEndpointReturnsValidSwaggerJson ( entryPointType , swaggerRequestUri ) ;
73+
7074 await Verifier . Verify ( swaggerResponse )
75+ . UseDirectory ( "snapshots" )
7176 . UseParameters ( entryPointType , GetVersion ( swaggerRequestUri ) )
7277 . UniqueForTargetFrameworkAndVersion ( ) ;
7378 }
@@ -79,7 +84,9 @@ public async Task TypesAreRenderedCorrectly()
7984 using var client = application . CreateDefaultClient ( ) ;
8085
8186 var swaggerResponse = await SwaggerResponse ( client , "/swagger/v1/swagger.json" ) ;
87+
8288 await Verifier . Verify ( swaggerResponse )
89+ . UseDirectory ( "snapshots" )
8390 . UniqueForTargetFrameworkAndVersion ( ) ;
8491 }
8592
@@ -100,9 +107,7 @@ private static async Task<string> SwaggerResponse(HttpClient client, string swag
100107 /// Normalize "\n" strings into "\r\n" which is expected linebreak in Verify verified.txt files.
101108 /// </summary>
102109 private static string NormalizeLineBreaks ( string swagger )
103- {
104- return UnixNewLineRegex ( ) . Replace ( swagger , "\\ r\\ n" ) ;
105- }
110+ => UnixNewLineRegex ( ) . Replace ( swagger , "\\ r\\ n" ) ;
106111
107112 private static string GetVersion ( string swaggerUi ) =>
108113 VersionRegex ( ) . Match ( swaggerUi ) . Groups [ 1 ] . Value ;
0 commit comments