@@ -26,10 +26,10 @@ public void Can_Deserialize_Complex_Types()
26
26
jsonApiContextMock . SetupAllProperties ( ) ;
27
27
jsonApiContextMock . Setup ( m => m . ContextGraph ) . Returns ( contextGraph ) ;
28
28
jsonApiContextMock . Setup ( m => m . AttributesToUpdate ) . Returns ( new Dictionary < AttrAttribute , object > ( ) ) ;
29
- jsonApiContextMock . Setup ( m => m . Options ) . Returns ( new JsonApiOptions
30
- {
31
- JsonContractResolver = new CamelCasePropertyNamesContractResolver ( )
32
- } ) ;
29
+
30
+ var jsonApiOptions = new JsonApiOptions ( ) ;
31
+ jsonApiOptions . SerializerSettings . ContractResolver = new CamelCasePropertyNamesContractResolver ( ) ;
32
+ jsonApiContextMock . Setup ( m => m . Options ) . Returns ( jsonApiOptions ) ;
33
33
34
34
var genericProcessorFactoryMock = new Mock < IGenericProcessorFactory > ( ) ;
35
35
@@ -69,10 +69,9 @@ public void Can_Deserialize_Complex_List_Types()
69
69
jsonApiContextMock . SetupAllProperties ( ) ;
70
70
jsonApiContextMock . Setup ( m => m . ContextGraph ) . Returns ( contextGraph ) ;
71
71
jsonApiContextMock . Setup ( m => m . AttributesToUpdate ) . Returns ( new Dictionary < AttrAttribute , object > ( ) ) ;
72
- jsonApiContextMock . Setup ( m => m . Options ) . Returns ( new JsonApiOptions
73
- {
74
- JsonContractResolver = new CamelCasePropertyNamesContractResolver ( )
75
- } ) ;
72
+ var jsonApiOptions = new JsonApiOptions ( ) ;
73
+ jsonApiOptions . SerializerSettings . ContractResolver = new CamelCasePropertyNamesContractResolver ( ) ;
74
+ jsonApiContextMock . Setup ( m => m . Options ) . Returns ( jsonApiOptions ) ;
76
75
77
76
var genericProcessorFactoryMock = new Mock < IGenericProcessorFactory > ( ) ;
78
77
@@ -116,10 +115,9 @@ public void Can_Deserialize_Complex_Types_With_Dasherized_Attrs()
116
115
jsonApiContextMock . Setup ( m => m . ContextGraph ) . Returns ( contextGraph ) ;
117
116
jsonApiContextMock . Setup ( m => m . AttributesToUpdate ) . Returns ( new Dictionary < AttrAttribute , object > ( ) ) ;
118
117
119
- jsonApiContextMock . Setup ( m => m . Options ) . Returns ( new JsonApiOptions
120
- {
121
- JsonContractResolver = new DasherizedResolver ( ) // <---
122
- } ) ;
118
+ var jsonApiOptions = new JsonApiOptions ( ) ;
119
+ jsonApiOptions . SerializerSettings . ContractResolver = new DasherizedResolver ( ) ; // <--
120
+ jsonApiContextMock . Setup ( m => m . Options ) . Returns ( jsonApiOptions ) ;
123
121
124
122
var genericProcessorFactoryMock = new Mock < IGenericProcessorFactory > ( ) ;
125
123
@@ -162,10 +160,9 @@ public void Immutable_Attrs_Are_Not_Included_In_AttributesToUpdate()
162
160
jsonApiContextMock . Setup ( m => m . ContextGraph ) . Returns ( contextGraph ) ;
163
161
jsonApiContextMock . Setup ( m => m . AttributesToUpdate ) . Returns ( attributesToUpdate ) ;
164
162
165
- jsonApiContextMock . Setup ( m => m . Options ) . Returns ( new JsonApiOptions
166
- {
167
- JsonContractResolver = new DasherizedResolver ( )
168
- } ) ;
163
+ var jsonApiOptions = new JsonApiOptions ( ) ;
164
+ jsonApiOptions . SerializerSettings . ContractResolver = new DasherizedResolver ( ) ;
165
+ jsonApiContextMock . Setup ( m => m . Options ) . Returns ( jsonApiOptions ) ;
169
166
170
167
var genericProcessorFactoryMock = new Mock < IGenericProcessorFactory > ( ) ;
171
168
@@ -178,8 +175,8 @@ public void Immutable_Attrs_Are_Not_Included_In_AttributesToUpdate()
178
175
Type = "test-resource" ,
179
176
Id = "1" ,
180
177
Attributes = new Dictionary < string , object > {
181
- { "complex-member" , new Dictionary < string , string > {
182
- { "compound-name" , "testName" } }
178
+ { "complex-member" , new Dictionary < string , string > {
179
+ { "compound-name" , "testName" } }
183
180
} ,
184
181
{ "immutable" , "value" }
185
182
}
@@ -194,8 +191,8 @@ public void Immutable_Attrs_Are_Not_Included_In_AttributesToUpdate()
194
191
// assert
195
192
Assert . NotNull ( result . ComplexMember ) ;
196
193
Assert . Equal ( 1 , attributesToUpdate . Count ) ;
197
-
198
- foreach ( var attr in attributesToUpdate )
194
+
195
+ foreach ( var attr in attributesToUpdate )
199
196
Assert . False ( attr . Key . IsImmutable ) ;
200
197
}
201
198
0 commit comments