@@ -26,10 +26,10 @@ public void Can_Deserialize_Complex_Types()
2626 jsonApiContextMock . SetupAllProperties ( ) ;
2727 jsonApiContextMock . Setup ( m => m . ContextGraph ) . Returns ( contextGraph ) ;
2828 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 ) ;
3333
3434 var genericProcessorFactoryMock = new Mock < IGenericProcessorFactory > ( ) ;
3535
@@ -69,10 +69,9 @@ public void Can_Deserialize_Complex_List_Types()
6969 jsonApiContextMock . SetupAllProperties ( ) ;
7070 jsonApiContextMock . Setup ( m => m . ContextGraph ) . Returns ( contextGraph ) ;
7171 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 ) ;
7675
7776 var genericProcessorFactoryMock = new Mock < IGenericProcessorFactory > ( ) ;
7877
@@ -116,10 +115,9 @@ public void Can_Deserialize_Complex_Types_With_Dasherized_Attrs()
116115 jsonApiContextMock . Setup ( m => m . ContextGraph ) . Returns ( contextGraph ) ;
117116 jsonApiContextMock . Setup ( m => m . AttributesToUpdate ) . Returns ( new Dictionary < AttrAttribute , object > ( ) ) ;
118117
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 ) ;
123121
124122 var genericProcessorFactoryMock = new Mock < IGenericProcessorFactory > ( ) ;
125123
@@ -162,10 +160,9 @@ public void Immutable_Attrs_Are_Not_Included_In_AttributesToUpdate()
162160 jsonApiContextMock . Setup ( m => m . ContextGraph ) . Returns ( contextGraph ) ;
163161 jsonApiContextMock . Setup ( m => m . AttributesToUpdate ) . Returns ( attributesToUpdate ) ;
164162
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 ) ;
169166
170167 var genericProcessorFactoryMock = new Mock < IGenericProcessorFactory > ( ) ;
171168
@@ -178,8 +175,8 @@ public void Immutable_Attrs_Are_Not_Included_In_AttributesToUpdate()
178175 Type = "test-resource" ,
179176 Id = "1" ,
180177 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" } }
183180 } ,
184181 { "immutable" , "value" }
185182 }
@@ -194,8 +191,8 @@ public void Immutable_Attrs_Are_Not_Included_In_AttributesToUpdate()
194191 // assert
195192 Assert . NotNull ( result . ComplexMember ) ;
196193 Assert . Equal ( 1 , attributesToUpdate . Count ) ;
197-
198- foreach ( var attr in attributesToUpdate )
194+
195+ foreach ( var attr in attributesToUpdate )
199196 Assert . False ( attr . Key . IsImmutable ) ;
200197 }
201198
0 commit comments