File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
test/Microsoft.OpenApi.Tests/Models Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -2249,6 +2249,8 @@ public async Task SerializeDocWithoutOperationSecurityWorks()
2249
2249
doc ! . SerializeAsV3 ( new OpenApiYamlWriter ( stringWriter , new OpenApiWriterSettings { InlineLocalReferences = true } ) ) ;
2250
2250
var actual = stringWriter . ToString ( ) ;
2251
2251
Assert . Equal ( expected . MakeLineBreaksEnvironmentNeutral ( ) , actual . MakeLineBreaksEnvironmentNeutral ( ) ) ;
2252
+ var actualOperation = doc . Paths [ "/repairs" ] ! . Operations ! [ HttpMethod . Get ] ;
2253
+ Assert . Null ( actualOperation . Security ) ;
2252
2254
}
2253
2255
2254
2256
[ Fact ]
@@ -2282,6 +2284,9 @@ public async Task SerializeDocWithEmptyOperationSecurityWorks()
2282
2284
doc ! . SerializeAsV3 ( new OpenApiYamlWriter ( stringWriter , new OpenApiWriterSettings { InlineLocalReferences = true } ) ) ;
2283
2285
var actual = stringWriter . ToString ( ) ;
2284
2286
Assert . Equal ( expected . MakeLineBreaksEnvironmentNeutral ( ) , actual . MakeLineBreaksEnvironmentNeutral ( ) ) ;
2287
+ var actualOperation = doc . Paths [ "/repairs" ] ! . Operations ! [ HttpMethod . Get ] ;
2288
+ Assert . NotNull ( actualOperation . Security ) ;
2289
+ Assert . Empty ( actualOperation . Security ) ;
2285
2290
}
2286
2291
}
2287
2292
}
You can’t perform that action at this time.
0 commit comments