@@ -36,6 +36,7 @@ public void HashShouldBeConstructableFromBytes()
36
36
37
37
// Then
38
38
Assert . Equal ( expected , actual ) ;
39
+ Assert . Equal ( 16 , candidate . Length ) ;
39
40
}
40
41
41
42
[ Fact ( DisplayName = "Hash should be constructable from byte and length" ) ]
@@ -52,6 +53,7 @@ public void HashShouldBeConstructableFromByteAndLength()
52
53
53
54
// Then
54
55
Assert . Equal ( expected , actual ) ;
56
+ Assert . Equal ( 16 , candidate . Length ) ;
55
57
}
56
58
57
59
[ Fact ( DisplayName = "Hash value should not be modified when altering the original byte array" ) ]
@@ -68,6 +70,7 @@ public void HashValueShouldNotBeModifiedWhenAlteringTheOriginalByteArray()
68
70
69
71
// Then
70
72
Assert . Equal ( expected , actual ) ;
73
+ Assert . Equal ( 4 , candidate . Length ) ;
71
74
}
72
75
73
76
[ Fact ( DisplayName = "Hash value should not be modified when altering the obtained byte array" ) ]
@@ -83,6 +86,7 @@ public void HashValueShouldNotBeModifiedWhenAlteringTheObtainedByteArray()
83
86
84
87
// Then
85
88
Assert . Equal ( expected , actual ) ;
89
+ Assert . Equal ( 4 , candidate . Length ) ;
86
90
}
87
91
88
92
[ Fact ( DisplayName = "Identical default hash values should be considered equal" ) ]
@@ -98,6 +102,9 @@ public void IdenticalDefaultHashValuesShouldBeConsideredEqual()
98
102
Assert . True ( left . Equals ( right ) ) ;
99
103
Assert . True ( left == right ) ;
100
104
Assert . False ( left != right ) ;
105
+
106
+ Assert . Equal ( 0 , left . Length ) ;
107
+ Assert . Equal ( 0 , right . Length ) ;
101
108
}
102
109
103
110
[ Fact ( DisplayName = "Identical hash values should be considered equal" ) ]
@@ -113,6 +120,9 @@ public void IdenticalHashValuesShouldBeConsideredEqual()
113
120
Assert . True ( left . Equals ( right ) ) ;
114
121
Assert . True ( left == right ) ;
115
122
Assert . False ( left != right ) ;
123
+
124
+ Assert . Equal ( 4 , left . Length ) ;
125
+ Assert . Equal ( 4 , right . Length ) ;
116
126
}
117
127
118
128
[ Fact ( DisplayName = "Different hash values should not be considered equal" ) ]
@@ -128,6 +138,9 @@ public void DifferentHashValuesShouldNotBeConsideredEqual()
128
138
Assert . False ( left . Equals ( right ) ) ;
129
139
Assert . False ( left == right ) ;
130
140
Assert . True ( left != right ) ;
141
+
142
+ Assert . Equal ( 4 , left . Length ) ;
143
+ Assert . Equal ( 4 , right . Length ) ;
131
144
}
132
145
133
146
[ Fact ( DisplayName = "Identical hash values should produce identical hash codes" ) ]
@@ -143,6 +156,9 @@ public void IdenticalHashValuesShouldProduceIdenticalHashCodes()
143
156
144
157
// Then
145
158
Assert . Equal ( leftHashCode , rightHashCode ) ;
159
+
160
+ Assert . Equal ( 4 , left . Length ) ;
161
+ Assert . Equal ( 4 , right . Length ) ;
146
162
}
147
163
148
164
[ Fact ( DisplayName = "Different hash values should produce different hash codes" ) ]
@@ -158,6 +174,9 @@ public void DifferentHashValuesShouldProduceDifferentHashCodes()
158
174
159
175
// Then
160
176
Assert . NotEqual ( leftHashCode , rightHashCode ) ;
177
+
178
+ Assert . Equal ( 4 , left . Length ) ;
179
+ Assert . Equal ( 4 , right . Length ) ;
161
180
}
162
181
163
182
[ Fact ( DisplayName = "Hashes should produce a negative-one sort order when the left-hand hash is lesser than the right-hand hash" ) ]
@@ -173,6 +192,9 @@ public void HashesShouldProduceANegativeOneSortOrderWhenTheLeftHandHashIsLesserT
173
192
174
193
// Then
175
194
Assert . Equal ( expected , actual ) ;
195
+
196
+ Assert . Equal ( 1 , left . Length ) ;
197
+ Assert . Equal ( 1 , right . Length ) ;
176
198
}
177
199
178
200
[ Fact ( DisplayName = "Hashes should produce a positive-one sort order when the left-hand hash is greater than the right-hand hash" ) ]
@@ -188,6 +210,9 @@ public void HashesShouldProduceAPositiveOneSortOrderWhenTheLeftHandHashIsGreater
188
210
189
211
// Then
190
212
Assert . Equal ( expected , actual ) ;
213
+
214
+ Assert . Equal ( 1 , left . Length ) ;
215
+ Assert . Equal ( 1 , right . Length ) ;
191
216
}
192
217
193
218
[ Fact ( DisplayName = "Hashes should produce a zero sort order when the left-hand hash is equal to the right-hand hash" ) ]
@@ -203,6 +228,9 @@ public void HashesShouldProduceAZeroSortOrderWhenTheLeftHandHashIsEqualToTheRigh
203
228
204
229
// Then
205
230
Assert . Equal ( expected , actual ) ;
231
+
232
+ Assert . Equal ( 1 , left . Length ) ;
233
+ Assert . Equal ( 1 , right . Length ) ;
206
234
}
207
235
208
236
[ Theory ( DisplayName = "Hash.Compute should produce the expected hash using a byte array" ) ]
0 commit comments