@@ -19,19 +19,28 @@ public OpenApiFilterServiceTests()
19
19
}
20
20
21
21
[ Theory ]
22
- [ InlineData ( "users.user.ListUser" ) ]
23
- [ InlineData ( "users.user.GetUser" ) ]
24
- [ InlineData ( "administrativeUnits.restore" ) ]
25
- [ InlineData ( "graphService.GetGraphService" ) ]
26
- public void ReturnFilteredOpenApiDocumentBasedOnOperationIds ( string operationId )
22
+ [ InlineData ( "users.user.ListUser" , null ) ]
23
+ [ InlineData ( "users.user.GetUser" , null ) ]
24
+ [ InlineData ( "administrativeUnits.restore" , null ) ]
25
+ [ InlineData ( "graphService.GetGraphService" , null ) ]
26
+ [ InlineData ( null , "users.user" ) ]
27
+ [ InlineData ( null , "applications.application" ) ]
28
+ public void ReturnFilteredOpenApiDocumentBasedOnOperationIds ( string operationIds , string tags )
27
29
{
28
30
// Act
29
- var predicate = OpenApiFilterService . CreatePredicate ( operationId ) ;
31
+ var predicate = OpenApiFilterService . CreatePredicate ( operationIds , tags ) ;
30
32
var subsetOpenApiDocument = OpenApiFilterService . CreateFilteredDocument ( _openApiDocumentMock , predicate ) ;
31
33
32
34
// Assert
33
35
Assert . NotNull ( subsetOpenApiDocument ) ;
34
- Assert . Single ( subsetOpenApiDocument . Paths ) ;
36
+ if ( ! string . IsNullOrEmpty ( operationIds ) )
37
+ {
38
+ Assert . Single ( subsetOpenApiDocument . Paths ) ;
39
+ }
40
+ else if ( ! string . IsNullOrEmpty ( tags ) )
41
+ {
42
+ Assert . NotEmpty ( subsetOpenApiDocument . Paths ) ;
43
+ }
35
44
}
36
45
37
46
[ Fact ]
0 commit comments