@@ -67,16 +67,16 @@ public void AddResourceService_Registers_All_Shorthand_Service_Interfaces()
67
67
68
68
// assert
69
69
var provider = services . BuildServiceProvider ( ) ;
70
- Assert . IsType < IntResourceService > ( typeof ( IResourceService < IntResource > ) ) ;
71
- Assert . IsType < IntResourceService > ( typeof ( IResourceCmdService < IntResource > ) ) ;
72
- Assert . IsType < IntResourceService > ( typeof ( IResourceQueryService < IntResource > ) ) ;
73
- Assert . IsType < IntResourceService > ( typeof ( IGetAllService < IntResource > ) ) ;
74
- Assert . IsType < IntResourceService > ( typeof ( IGetByIdService < IntResource > ) ) ;
75
- Assert . IsType < IntResourceService > ( typeof ( IGetRelationshipService < IntResource > ) ) ;
76
- Assert . IsType < IntResourceService > ( typeof ( IGetRelationshipsService < IntResource > ) ) ;
77
- Assert . IsType < IntResourceService > ( typeof ( ICreateService < IntResource > ) ) ;
78
- Assert . IsType < IntResourceService > ( typeof ( IUpdateService < IntResource > ) ) ;
79
- Assert . IsType < IntResourceService > ( typeof ( IDeleteService < IntResource > ) ) ;
70
+ Assert . IsType < IntResourceService > ( provider . GetService ( typeof ( IResourceService < IntResource > ) ) ) ;
71
+ Assert . IsType < IntResourceService > ( provider . GetService ( typeof ( IResourceCmdService < IntResource > ) ) ) ;
72
+ Assert . IsType < IntResourceService > ( provider . GetService ( typeof ( IResourceQueryService < IntResource > ) ) ) ;
73
+ Assert . IsType < IntResourceService > ( provider . GetService ( typeof ( IGetAllService < IntResource > ) ) ) ;
74
+ Assert . IsType < IntResourceService > ( provider . GetService ( typeof ( IGetByIdService < IntResource > ) ) ) ;
75
+ Assert . IsType < IntResourceService > ( provider . GetService ( typeof ( IGetRelationshipService < IntResource > ) ) ) ;
76
+ Assert . IsType < IntResourceService > ( provider . GetService ( typeof ( IGetRelationshipsService < IntResource > ) ) ) ;
77
+ Assert . IsType < IntResourceService > ( provider . GetService ( typeof ( ICreateService < IntResource > ) ) ) ;
78
+ Assert . IsType < IntResourceService > ( provider . GetService ( typeof ( IUpdateService < IntResource > ) ) ) ;
79
+ Assert . IsType < IntResourceService > ( provider . GetService ( typeof ( IDeleteService < IntResource > ) ) ) ;
80
80
}
81
81
82
82
[ Fact ]
@@ -90,16 +90,16 @@ public void AddResourceService_Registers_All_LongForm_Service_Interfaces()
90
90
91
91
// assert
92
92
var provider = services . BuildServiceProvider ( ) ;
93
- Assert . IsType < GuidResourceService > ( typeof ( IResourceService < GuidResource , Guid > ) ) ;
94
- Assert . IsType < GuidResourceService > ( typeof ( IResourceCmdService < GuidResource , Guid > ) ) ;
95
- Assert . IsType < GuidResourceService > ( typeof ( IResourceQueryService < GuidResource , Guid > ) ) ;
96
- Assert . IsType < GuidResourceService > ( typeof ( IGetAllService < GuidResource , Guid > ) ) ;
97
- Assert . IsType < GuidResourceService > ( typeof ( IGetByIdService < GuidResource , Guid > ) ) ;
98
- Assert . IsType < GuidResourceService > ( typeof ( IGetRelationshipService < GuidResource , Guid > ) ) ;
99
- Assert . IsType < GuidResourceService > ( typeof ( IGetRelationshipsService < GuidResource , Guid > ) ) ;
100
- Assert . IsType < GuidResourceService > ( typeof ( ICreateService < GuidResource , Guid > ) ) ;
101
- Assert . IsType < GuidResourceService > ( typeof ( IUpdateService < GuidResource , Guid > ) ) ;
102
- Assert . IsType < GuidResourceService > ( typeof ( IDeleteService < GuidResource , Guid > ) ) ;
93
+ Assert . IsType < GuidResourceService > ( provider . GetService ( typeof ( IResourceService < GuidResource , Guid > ) ) ) ;
94
+ Assert . IsType < GuidResourceService > ( provider . GetService ( typeof ( IResourceCmdService < GuidResource , Guid > ) ) ) ;
95
+ Assert . IsType < GuidResourceService > ( provider . GetService ( typeof ( IResourceQueryService < GuidResource , Guid > ) ) ) ;
96
+ Assert . IsType < GuidResourceService > ( provider . GetService ( typeof ( IGetAllService < GuidResource , Guid > ) ) ) ;
97
+ Assert . IsType < GuidResourceService > ( provider . GetService ( typeof ( IGetByIdService < GuidResource , Guid > ) ) ) ;
98
+ Assert . IsType < GuidResourceService > ( provider . GetService ( typeof ( IGetRelationshipService < GuidResource , Guid > ) ) ) ;
99
+ Assert . IsType < GuidResourceService > ( provider . GetService ( typeof ( IGetRelationshipsService < GuidResource , Guid > ) ) ) ;
100
+ Assert . IsType < GuidResourceService > ( provider . GetService ( typeof ( ICreateService < GuidResource , Guid > ) ) ) ;
101
+ Assert . IsType < GuidResourceService > ( provider . GetService ( typeof ( IUpdateService < GuidResource , Guid > ) ) ) ;
102
+ Assert . IsType < GuidResourceService > ( provider . GetService ( typeof ( IDeleteService < GuidResource , Guid > ) ) ) ;
103
103
}
104
104
105
105
[ Fact ]
@@ -109,7 +109,7 @@ public void AddResourceService_Throws_If_Type_Does_Not_Implement_Any_Interfaces(
109
109
var services = new ServiceCollection ( ) ;
110
110
111
111
// act, assert
112
- Assert . Throws < JsonApiException > ( ( ) => services . AddResourceService < int > ( ) ) ;
112
+ Assert . Throws < JsonApiSetupException > ( ( ) => services . AddResourceService < int > ( ) ) ;
113
113
}
114
114
115
115
private class IntResource : Identifiable { }
0 commit comments