@@ -12,7 +12,7 @@ public void IsNullOrEmpty_GivenNullList() {
1212 var result = list . IsNullOrEmpty ( ) ;
1313
1414 // Assert
15- result . Should ( ) . BeTrue ( ) ;
15+ Assert . True ( result ) ;
1616 }
1717
1818 [ Fact ]
@@ -24,7 +24,7 @@ public void IsNullOrEmpty_GivenEmptyList() {
2424 var result = list . IsNullOrEmpty ( ) ;
2525
2626 // Assert
27- result . Should ( ) . BeTrue ( ) ;
27+ Assert . True ( result ) ;
2828 }
2929
3030 [ Fact ]
@@ -36,9 +36,9 @@ public void AsSpan_GivenNonEmptyList_ReturnsCorrectSpan() {
3636 var span = list . AsSpan ( ) ;
3737
3838 // Assert
39- span . Length . Should ( ) . Be ( list . Count ) ;
39+ Assert . Equal ( list . Count , span . Length ) ;
4040 for ( int i = 0 ; i < list . Count ; i ++ ) {
41- span [ i ] . Should ( ) . Be ( list [ i ] ) ;
41+ Assert . Equal ( list [ i ] , span [ i ] ) ;
4242 }
4343 }
4444
@@ -51,7 +51,7 @@ public void AsSpan_GivenEmptyList_ReturnsEmptySpan() {
5151 var span = list . AsSpan ( ) ;
5252
5353 // Assert
54- span . Length . Should ( ) . Be ( 0 ) ;
54+ Assert . Equal ( 0 , span . Length ) ;
5555 }
5656
5757 [ Fact ]
@@ -70,7 +70,7 @@ public void GetValueRefOrNullRef_GivenExistingKey_ReturnsRefToValue() {
7070 ref var valueReal = ref CollectionsMarshal . GetValueRefOrNullRef ( dictionary , key ) ;
7171
7272 // Assert
73- Unsafe . AreSame ( ref valueRef , ref valueReal ) . Should ( ) . BeTrue ( ) ;
73+ Assert . True ( Unsafe . AreSame ( ref valueRef , ref valueReal ) ) ;
7474 }
7575
7676 [ Fact ]
@@ -83,7 +83,7 @@ public void GetValueRefOrNullRef_GivenNonExistingKey_ReturnsRefNull() {
8383 ref var valueRef = ref dictionary . GetValueRefOrNullRef ( key ) ;
8484
8585 // Assert
86- Unsafe . IsNullRef ( ref valueRef ) . Should ( ) . BeTrue ( ) ;
86+ Assert . True ( Unsafe . IsNullRef ( ref valueRef ) ) ;
8787 }
8888
8989 [ Fact ]
@@ -101,8 +101,8 @@ public void GetValueRefOrAddDefault_GivenExistingKey_ReturnsRefToValueAndDoesNot
101101 ref var valueRef = ref dictionary . GetValueRefOrAddDefault ( key , out bool exists ) ;
102102
103103 // Assert
104- valueRef . Should ( ) . BeEquivalentTo ( "two" ) ;
105- exists . Should ( ) . BeTrue ( ) ;
104+ Assert . Equal ( "two" , valueRef ) ;
105+ Assert . True ( exists ) ;
106106 }
107107
108108 [ Fact ]
@@ -116,9 +116,9 @@ public void GetValueRefOrAddDefault_GivenNonExistingKey_AddsNewEntryWithDefaultV
116116
117117 // Assert
118118 #pragma warning disable
119- valueRef . Should ( ) . Be ( default ( string ) ) ;
120- exists . Should ( ) . BeFalse ( ) ;
121- dictionary . Should ( ) . ContainKey ( key ) . And . ContainValue ( default ( string ) ) ;
119+ Assert . Equal ( default ( string ) , valueRef ) ;
120+ Assert . False ( exists ) ;
121+ Assert . Contains ( new KeyValuePair < int , string > ( key , default ( string ) ) , dictionary ) ;
122122 #pragma warning restore
123123 }
124124
@@ -128,7 +128,7 @@ public void CopyTo_CopiesDictionaryEntries() {
128128 var buffer = ArrayPool < KeyValuePair < int , int > > . Shared . Rent ( dict . Count ) ;
129129 dict . CopyTo ( buffer , 0 ) ;
130130 var span = new Span < KeyValuePair < int , int > > ( buffer , 0 , dict . Count ) ;
131- span . ToArray ( ) . Should ( ) . Equal ( dict ) ;
131+ Assert . Equal ( dict , span . ToArray ( ) ) ;
132132 buffer . ReturnBufferToSharedArrayPool ( ) ;
133133 }
134134
@@ -137,7 +137,7 @@ public void RentBufferAndCopyEntries_ReturnRentedBuffer_Dictionary() {
137137 var dict = Enumerable . Range ( 1 , 10 ) . ToDictionary ( i => i , i => i ) ;
138138 var ( buffer , entries ) = dict . RentBufferAndCopyEntries ( ) ;
139139 try {
140- entries . ToArray ( ) . Should ( ) . Equal ( dict ) ;
140+ Assert . Equal ( dict , entries . ToArray ( ) ) ;
141141 } finally {
142142 buffer . ReturnBufferToSharedArrayPool ( ) ;
143143 }
@@ -150,7 +150,7 @@ public void Dictionary_CopyToArray() {
150150 dict . CopyTo ( buffer , 0 ) ;
151151 var span = buffer . AsSpan ( 0 , dict . Count ) ;
152152 try {
153- span . SequenceEqual ( dict . ToArray ( ) ) . Should ( ) . BeTrue ( ) ;
153+ Assert . Equal ( dict , span . ToArray ( ) ) ;
154154 } finally {
155155 buffer . ReturnBufferToSharedArrayPool ( ) ;
156156 }
@@ -166,7 +166,7 @@ public void PureSort_GivenUnsortedIntArray_ReturnsSortedIntArray() {
166166 var result = source . PureSort ( Comparer < int > . Default ) ;
167167
168168 // Assert
169- result . Should ( ) . Equal ( expected ) ;
169+ Assert . Equal ( expected , result ) ;
170170 }
171171
172172 [ Fact ]
@@ -179,7 +179,7 @@ public void PureSort_GivenUnsortedStringArray_ReturnsSortedStringArray() {
179179 var result = source . PureSort ( StringComparer . InvariantCulture ) ;
180180
181181 // Assert
182- result . Should ( ) . Equal ( expected ) ;
182+ Assert . Equal ( expected , result ) ;
183183 }
184184
185185 [ Fact ]
@@ -192,7 +192,7 @@ public void PureSort_GivenUnsortedIntList_ReturnsSortedIntList() {
192192 var result = source . PureSort ( Comparer < int > . Default ) ;
193193
194194 // Assert
195- result . Should ( ) . Equal ( expected ) ;
195+ Assert . Equal ( expected , result ) ;
196196 }
197197
198198 [ Fact ]
@@ -205,7 +205,7 @@ public void PureSort_GivenUnsortedStringList_ReturnsSortedStringList() {
205205 var result = source . PureSort ( Comparer < string > . Default ) ;
206206
207207 // Assert
208- result . Should ( ) . Equal ( expected ) ;
208+ Assert . Equal ( expected , result ) ;
209209 }
210210
211211 [ Fact ]
@@ -218,7 +218,7 @@ public void RemoveDuplicates_GivenListWithDuplicates_RemovesDuplicates() {
218218 list . RemoveDuplicates ( ) ;
219219
220220 // Assert
221- list . Should ( ) . Equal ( expected ) ;
221+ Assert . Equal ( expected , list ) ;
222222 }
223223
224224 [ Fact ]
@@ -231,8 +231,8 @@ public void RemoveDuplicatesWithHashSet_GivenListWithDuplicates_RemovesDuplicate
231231 list . RemoveDuplicates ( out var hSet ) ;
232232
233233 // Assert
234- list . Should ( ) . Equal ( expected ) ;
235- hSet . Should ( ) . HaveCount ( expected . Count ) ;
234+ Assert . Equal ( expected , list ) ;
235+ Assert . Equal ( expected . Count , hSet . Count ) ;
236236 }
237237
238238 [ Fact ]
@@ -245,7 +245,7 @@ public void RemoveDuplicates_GivenListWithNoDuplicates_DoesNotModifyList() {
245245 list . RemoveDuplicates ( comparer : StringComparer . InvariantCulture ) ;
246246
247247 // Assert
248- list . Should ( ) . Equal ( expected ) ;
248+ Assert . Equal ( expected , list ) ;
249249 }
250250
251251 [ Fact ]
@@ -258,7 +258,7 @@ public void RemoveDuplicates_Sorted_GivenSortedListWithDuplicates_RemovesDuplica
258258 list . RemoveDuplicates ( isSorted : true ) ;
259259
260260 // Assert
261- list . Should ( ) . Equal ( expected ) ;
261+ Assert . Equal ( expected , list ) ;
262262 }
263263
264264 [ Fact ]
@@ -271,7 +271,7 @@ public void RemoveDuplicates_Sorted_GivenSortedListWithNoDuplicates_DoesNotModif
271271 list . RemoveDuplicates ( isSorted : true , comparer : StringComparer . InvariantCulture ) ;
272272
273273 // Assert
274- list . Should ( ) . Equal ( expected ) ;
274+ Assert . Equal ( expected , list ) ;
275275 }
276276
277277 [ Fact ]
@@ -283,7 +283,7 @@ public void ChunkToSegments_GivenEmptyArray_ReturnsEmptyList() {
283283 var result = array . ChunkToSegments ( 3 ) ;
284284
285285 // Assert
286- result . Should ( ) . BeEmpty ( ) ;
286+ Assert . Empty ( result ) ;
287287 }
288288
289289 [ Fact ]
@@ -295,8 +295,8 @@ public void ChunkToSegments_GivenArrayWithLengthLessThanSegmentSize_ReturnsSingl
295295 var result = array . ChunkToSegments ( 5 ) ;
296296
297297 // Assert
298- result . Should ( ) . HaveCount ( 1 ) ;
299- result [ 0 ] . Should ( ) . Equal ( array ) ;
298+ Assert . Single ( result ) ;
299+ Assert . Equal ( array , result [ 0 ] ) ;
300300 }
301301
302302 [ Fact ]
@@ -308,7 +308,7 @@ public void ChunkToSegments_GivenValidArray_ReturnsCorrectNumberOfSegments() {
308308 var result = array . ChunkToSegments ( 3 ) ;
309309
310310 // Assert
311- result . Should ( ) . HaveCount ( 3 ) ;
312- result . Sum ( s => s . Count ) . Should ( ) . Be ( array . Length ) ;
311+ Assert . Equal ( 3 , result . Count ) ;
312+ Assert . Equal ( array . Length , result . Sum ( s => s . Count ) ) ;
313313 }
314314}
0 commit comments