@@ -18,27 +18,27 @@ namespace UnitTests.Middleware
18
18
public sealed class JsonApiRequestTests
19
19
{
20
20
[ Theory ]
21
- [ InlineData ( "HEAD" , "/todoItems" , true , EndpointKind . Primary , true ) ]
22
- [ InlineData ( "HEAD" , "/todoItems/1" , false , EndpointKind . Primary , true ) ]
23
- [ InlineData ( "HEAD" , "/todoItems/1/owner" , false , EndpointKind . Secondary , true ) ]
24
- [ InlineData ( "HEAD" , "/todoItems/1/tags" , true , EndpointKind . Secondary , true ) ]
25
- [ InlineData ( "HEAD" , "/todoItems/1/relationships/owner" , false , EndpointKind . Relationship , true ) ]
26
- [ InlineData ( "HEAD" , "/todoItems/1/relationships/tags" , true , EndpointKind . Relationship , true ) ]
27
- [ InlineData ( "GET" , "/todoItems" , true , EndpointKind . Primary , true ) ]
28
- [ InlineData ( "GET" , "/todoItems/1" , false , EndpointKind . Primary , true ) ]
29
- [ InlineData ( "GET" , "/todoItems/1/owner" , false , EndpointKind . Secondary , true ) ]
30
- [ InlineData ( "GET" , "/todoItems/1/tags" , true , EndpointKind . Secondary , true ) ]
31
- [ InlineData ( "GET" , "/todoItems/1/relationships/owner" , false , EndpointKind . Relationship , true ) ]
32
- [ InlineData ( "GET" , "/todoItems/1/relationships/tags" , true , EndpointKind . Relationship , true ) ]
33
- [ InlineData ( "POST" , "/todoItems" , false , EndpointKind . Primary , false ) ]
34
- [ InlineData ( "POST" , "/todoItems/1/relationships/tags" , true , EndpointKind . Relationship , false ) ]
35
- [ InlineData ( "PATCH" , "/todoItems/1" , false , EndpointKind . Primary , false ) ]
36
- [ InlineData ( "PATCH" , "/todoItems/1/relationships/owner" , false , EndpointKind . Relationship , false ) ]
37
- [ InlineData ( "PATCH" , "/todoItems/1/relationships/tags" , true , EndpointKind . Relationship , false ) ]
38
- [ InlineData ( "DELETE" , "/todoItems/1" , false , EndpointKind . Primary , false ) ]
39
- [ InlineData ( "DELETE" , "/todoItems/1/relationships/tags" , true , EndpointKind . Relationship , false ) ]
21
+ [ InlineData ( "HEAD" , "/todoItems" , true , EndpointKind . Primary , null , true ) ]
22
+ [ InlineData ( "HEAD" , "/todoItems/1" , false , EndpointKind . Primary , null , true ) ]
23
+ [ InlineData ( "HEAD" , "/todoItems/1/owner" , false , EndpointKind . Secondary , null , true ) ]
24
+ [ InlineData ( "HEAD" , "/todoItems/1/tags" , true , EndpointKind . Secondary , null , true ) ]
25
+ [ InlineData ( "HEAD" , "/todoItems/1/relationships/owner" , false , EndpointKind . Relationship , null , true ) ]
26
+ [ InlineData ( "HEAD" , "/todoItems/1/relationships/tags" , true , EndpointKind . Relationship , null , true ) ]
27
+ [ InlineData ( "GET" , "/todoItems" , true , EndpointKind . Primary , null , true ) ]
28
+ [ InlineData ( "GET" , "/todoItems/1" , false , EndpointKind . Primary , null , true ) ]
29
+ [ InlineData ( "GET" , "/todoItems/1/owner" , false , EndpointKind . Secondary , null , true ) ]
30
+ [ InlineData ( "GET" , "/todoItems/1/tags" , true , EndpointKind . Secondary , null , true ) ]
31
+ [ InlineData ( "GET" , "/todoItems/1/relationships/owner" , false , EndpointKind . Relationship , null , true ) ]
32
+ [ InlineData ( "GET" , "/todoItems/1/relationships/tags" , true , EndpointKind . Relationship , null , true ) ]
33
+ [ InlineData ( "POST" , "/todoItems" , false , EndpointKind . Primary , OperationKind . CreateResource , false ) ]
34
+ [ InlineData ( "POST" , "/todoItems/1/relationships/tags" , true , EndpointKind . Relationship , OperationKind . AddToRelationship , false ) ]
35
+ [ InlineData ( "PATCH" , "/todoItems/1" , false , EndpointKind . Primary , OperationKind . UpdateResource , false ) ]
36
+ [ InlineData ( "PATCH" , "/todoItems/1/relationships/owner" , false , EndpointKind . Relationship , OperationKind . SetRelationship , false ) ]
37
+ [ InlineData ( "PATCH" , "/todoItems/1/relationships/tags" , true , EndpointKind . Relationship , OperationKind . SetRelationship , false ) ]
38
+ [ InlineData ( "DELETE" , "/todoItems/1" , false , EndpointKind . Primary , OperationKind . DeleteResource , false ) ]
39
+ [ InlineData ( "DELETE" , "/todoItems/1/relationships/tags" , true , EndpointKind . Relationship , OperationKind . RemoveFromRelationship , false ) ]
40
40
public async Task Sets_request_properties_correctly ( string requestMethod , string requestPath , bool expectIsCollection , EndpointKind expectKind ,
41
- bool expectIsReadOnly )
41
+ OperationKind ? expectOperationKind , bool expectIsReadOnly )
42
42
{
43
43
// Arrange
44
44
var options = new JsonApiOptions
@@ -69,6 +69,7 @@ public async Task Sets_request_properties_correctly(string requestMethod, string
69
69
// Assert
70
70
request . IsCollection . Should ( ) . Be ( expectIsCollection ) ;
71
71
request . Kind . Should ( ) . Be ( expectKind ) ;
72
+ request . OperationKind . Should ( ) . Be ( expectOperationKind ) ;
72
73
request . IsReadOnly . Should ( ) . Be ( expectIsReadOnly ) ;
73
74
request . PrimaryResource . Should ( ) . NotBeNull ( ) ;
74
75
request . PrimaryResource . PublicName . Should ( ) . Be ( "todoItems" ) ;
0 commit comments