@@ -76,67 +76,67 @@ public void When_objects_differ_BeEquivalentTo_should_fail()
7676 Tuple . Create (
7777 ( string ) null ,
7878 "{ id: 2 }" ,
79- "it is null" )
79+ "is null" )
8080 ,
8181 Tuple . Create (
8282 "{ id: 1 }" ,
8383 ( string ) null ,
84- "it is not null" )
84+ "is not null" )
8585 ,
8686 Tuple . Create (
8787 "{ items: [] }" ,
8888 "{ items: 2 }" ,
89- "the type is different at $.items" )
89+ "has a different type at $.items" )
9090 ,
9191 Tuple . Create (
9292 "{ items: [ \" fork\" , \" knife\" , \" spoon\" ]}" ,
9393 "{ items: [ \" fork\" , \" knife\" ]}" ,
94- "the length is different at $.items" )
94+ "has a different length at $.items" )
9595 ,
9696 Tuple . Create (
97- "{ items: [ \" fork\" , \" knife\" , \" spoon\" ]}" ,
9897 "{ items: [ \" fork\" , \" knife\" ]}" ,
99- "the length is different at $.items" )
98+ "{ items: [ \" fork\" , \" knife\" , \" spoon\" ]}" ,
99+ "has a different length at $.items" )
100100 ,
101101 Tuple . Create (
102102 "{ items: [ \" fork\" , \" knife\" , \" spoon\" ]}" ,
103103 "{ items: [ \" fork\" , \" spoon\" , \" knife\" ]}" ,
104- "the value is different at $.items[1]" )
104+ "has a different value at $.items[1]" )
105105 ,
106106 Tuple . Create (
107107 "{ tree: { } }" ,
108108 "{ tree: \" oak\" }" ,
109- "the type is different at $.tree" )
109+ "has a different type at $.tree" )
110110 ,
111111 Tuple . Create (
112112 "{ tree: { leaves: 10} }" ,
113113 "{ tree: { branches: 5, leaves: 10 } }" ,
114- "it misses property $.tree.branches" )
114+ "misses property $.tree.branches" )
115115 ,
116116 Tuple . Create (
117117 "{ tree: { branches: 5, leaves: 10 } }" ,
118118 "{ tree: { leaves: 10} }" ,
119- "it has extra property $.tree.branches" )
119+ "has extra property $.tree.branches" )
120120 ,
121121 Tuple . Create (
122122 "{ tree: { leaves: 5 } }" ,
123123 "{ tree: { leaves: 10} }" ,
124- "the value is different at $.tree.leaves" )
124+ "has a different value at $.tree.leaves" )
125125 ,
126126 Tuple . Create (
127127 "{ eyes: \" blue\" }" ,
128128 "{ eyes: [] }" ,
129- "the type is different at $.eyes" )
129+ "has a different type at $.eyes" )
130130 ,
131131 Tuple . Create (
132132 "{ eyes: \" blue\" }" ,
133133 "{ eyes: 2 }" ,
134- "the type is different at $.eyes" )
134+ "has a different type at $.eyes" )
135135 ,
136136 Tuple . Create (
137137 "{ id: 1 }" ,
138138 "{ id: 2 }" ,
139- "the value is different at $.id" )
139+ "has a different value at $.id" )
140140 } ;
141141
142142 foreach ( var testCase in testCases )
@@ -149,9 +149,11 @@ public void When_objects_differ_BeEquivalentTo_should_fail()
149149 var expected = ( expectedJson != null ) ? JToken . Parse ( expectedJson ) : null ;
150150
151151 var expectedMessage =
152- $ "Expected JSON document { Format ( actual , true ) } " +
153- $ "to be equivalent to { Format ( expected , true ) } , " +
154- "but " + expectedDifference + "." ;
152+ $ "JSON document { expectedDifference } ." +
153+ $ "Expected" +
154+ $ "{ Format ( actual , true ) } " +
155+ $ "to be equivalent to" +
156+ $ "{ Format ( expected , true ) } .";
155157
156158 //-----------------------------------------------------------------------------------------------------------
157159 // Act & Assert
@@ -173,29 +175,32 @@ public void When_properties_differ_BeEquivalentTo_should_fail()
173175 Tuple . Create < JToken , JToken , string > (
174176 new JProperty ( "eyes" , "blue" ) ,
175177 new JArray ( ) ,
176- "the type is different at $" )
178+ "has a different type at $" )
177179 ,
178180 Tuple . Create < JToken , JToken , string > (
179181 new JProperty ( "eyes" , "blue" ) ,
180182 new JProperty ( "hair" , "black" ) ,
181- "the name is different at $" )
183+ "has a different name at $" )
182184 ,
183185 } ;
184186
185187 foreach ( var testCase in testCases )
186188 {
187- var a = testCase . Item1 ;
188- var b = testCase . Item2 ;
189-
189+ var actual = testCase . Item1 ;
190+ var expected = testCase . Item2 ;
191+ var expectedDifference = testCase . Item3 ;
192+
190193 var expectedMessage =
191- $ "Expected JSON document { Format ( a , true ) } " +
192- $ "to be equivalent to { Format ( b , true ) } , " +
193- "but " + testCase . Item3 + "." ;
194+ $ "JSON document { expectedDifference } ." +
195+ $ "Expected" +
196+ $ "{ Format ( actual , true ) } " +
197+ $ "to be equivalent to" +
198+ $ "{ Format ( expected , true ) } .";
194199
195200 //-----------------------------------------------------------------------------------------------------------
196201 // Act & Assert
197202 //-----------------------------------------------------------------------------------------------------------
198- a . Should ( ) . Invoking ( x => x . BeEquivalentTo ( b ) )
203+ actual . Should ( ) . Invoking ( x => x . BeEquivalentTo ( expected ) )
199204 . Should ( ) . Throw < XunitException > ( )
200205 . WithMessage ( expectedMessage ) ;
201206 }
@@ -360,10 +365,12 @@ public void When_specifying_a_reason_why_object_should_be_equivalent_it_should_u
360365 var expected = JToken . Parse ( "{ child: { expected: 'bar' } }" ) ;
361366
362367 var expectedMessage =
363- $ "Expected JSON document { Format ( subject , true ) } " +
364- $ "to be equivalent to { Format ( expected , true ) } " +
365- "because we want to test the failure message, " +
366- "but it misses property $.child.expected." ;
368+ $ "JSON document misses property $.child.expected." +
369+ $ "Expected" +
370+ $ "{ Format ( subject , true ) } " +
371+ $ "to be equivalent to" +
372+ $ "{ Format ( expected , true ) } " +
373+ "because we want to test the failure message." ;
367374
368375 //-----------------------------------------------------------------------------------------------------------
369376 // Act & Assert
0 commit comments