@@ -47,9 +47,9 @@ public void DisposalInvalidation_DisposingOriginal_InvalidatesAllCopies()
4747 original . Dispose ( ) ;
4848
4949 // All copies should now be invalid
50- Assert . Throws < ArgumentException > ( ( ) => original . AsSpan ( ) ) ;
51- Assert . Throws < ArgumentException > ( ( ) => copy1 . AsSpan ( ) ) ;
52- Assert . Throws < ArgumentException > ( ( ) => copy2 . AsSpan ( ) ) ;
50+ _ = Assert . Throws < ArgumentException > ( ( ) => original . AsSpan ( ) ) ;
51+ _ = Assert . Throws < ArgumentException > ( ( ) => copy1 . AsSpan ( ) ) ;
52+ _ = Assert . Throws < ArgumentException > ( ( ) => copy2 . AsSpan ( ) ) ;
5353 }
5454
5555 /// <summary>
@@ -67,9 +67,9 @@ public void DisposalInvalidation_DisposingCopy_InvalidatesOriginalAndAllCopies()
6767 copy1 . Dispose ( ) ;
6868
6969 // All instances should now be invalid
70- Assert . Throws < ArgumentException > ( ( ) => original . AsSpan ( ) ) ;
71- Assert . Throws < ArgumentException > ( ( ) => copy1 . AsSpan ( ) ) ;
72- Assert . Throws < ArgumentException > ( ( ) => copy2 . AsSpan ( ) ) ;
70+ _ = Assert . Throws < ArgumentException > ( ( ) => original . AsSpan ( ) ) ;
71+ _ = Assert . Throws < ArgumentException > ( ( ) => copy1 . AsSpan ( ) ) ;
72+ _ = Assert . Throws < ArgumentException > ( ( ) => copy2 . AsSpan ( ) ) ;
7373 }
7474
7575 /// <summary>
@@ -92,8 +92,8 @@ public void MultipleDisposals_DisposingMultipleTimes_IsSafe()
9292 copy . Free ( ) ; // Free the copy
9393
9494 // All should still be invalid
95- Assert . Throws < ArgumentException > ( ( ) => original . AsSpan ( ) ) ;
96- Assert . Throws < ArgumentException > ( ( ) => copy . AsSpan ( ) ) ;
95+ _ = Assert . Throws < ArgumentException > ( ( ) => original . AsSpan ( ) ) ;
96+ _ = Assert . Throws < ArgumentException > ( ( ) => copy . AsSpan ( ) ) ;
9797 }
9898
9999 /// <summary>
@@ -141,8 +141,8 @@ public void EmptyStrings_CopyingEmptyString_BehavesCorrectly()
141141 // Empty strings don't have actual allocations to invalidate
142142 // But after pool disposal, operations requiring the pool will fail
143143 pool . Dispose ( ) ;
144- Assert . Throws < ObjectDisposedException > ( ( ) => empty1 . Insert ( 0 , "text" ) ) ;
145- Assert . Throws < ObjectDisposedException > ( ( ) => empty2 . Insert ( 0 , "text" ) ) ;
144+ _ = Assert . Throws < ObjectDisposedException > ( ( ) => empty1 . Insert ( 0 , "text" ) ) ;
145+ _ = Assert . Throws < ObjectDisposedException > ( ( ) => empty2 . Insert ( 0 , "text" ) ) ;
146146 }
147147
148148 /// <summary>
@@ -189,7 +189,7 @@ public void UsingBlocks_CopyAcrossUsingBlocks_InvalidatesCorrectly()
189189 }
190190
191191 // After the using block, original is disposed, so copy is invalid
192- Assert . Throws < ArgumentException > ( ( ) => copyOutsideUsing . AsSpan ( ) ) ;
192+ _ = Assert . Throws < ArgumentException > ( ( ) => copyOutsideUsing . AsSpan ( ) ) ;
193193 }
194194
195195 /// <summary>
@@ -204,15 +204,15 @@ public void FreeVsDispose_BothMethods_HaveSameCopyInvalidationBehavior()
204204 var str1 = pool . Allocate ( "Test Free" ) ;
205205 var copy1 = str1 ;
206206 str1 . Free ( ) ;
207- Assert . Throws < ArgumentException > ( ( ) => str1 . AsSpan ( ) ) ;
208- Assert . Throws < ArgumentException > ( ( ) => copy1 . AsSpan ( ) ) ;
207+ _ = Assert . Throws < ArgumentException > ( ( ) => str1 . AsSpan ( ) ) ;
208+ _ = Assert . Throws < ArgumentException > ( ( ) => copy1 . AsSpan ( ) ) ;
209209
210210 // Test Dispose()
211211 var str2 = pool . Allocate ( "Test Dispose" ) ;
212212 var copy2 = str2 ;
213213 str2 . Dispose ( ) ;
214- Assert . Throws < ArgumentException > ( ( ) => str2 . AsSpan ( ) ) ;
215- Assert . Throws < ArgumentException > ( ( ) => copy2 . AsSpan ( ) ) ;
214+ _ = Assert . Throws < ArgumentException > ( ( ) => str2 . AsSpan ( ) ) ;
215+ _ = Assert . Throws < ArgumentException > ( ( ) => copy2 . AsSpan ( ) ) ;
216216 }
217217
218218 /// <summary>
@@ -268,8 +268,8 @@ public void Assignment_SimpleAssignment_CreatesCopyWithSharedAllocation()
268268
269269 // Disposing either a or b invalidates both
270270 b . Dispose ( ) ;
271- Assert . Throws < ArgumentException > ( ( ) => a . AsSpan ( ) ) ;
272- Assert . Throws < ArgumentException > ( ( ) => b . AsSpan ( ) ) ;
271+ _ = Assert . Throws < ArgumentException > ( ( ) => a . AsSpan ( ) ) ;
272+ _ = Assert . Throws < ArgumentException > ( ( ) => b . AsSpan ( ) ) ;
273273 }
274274
275275 /// <summary>
@@ -308,7 +308,7 @@ public void Duplicate_DisposingDuplicate_DoesNotAffectOriginal()
308308 Assert . Equal ( "Test Duplicate Independence" , original . ToString ( ) ) ;
309309
310310 // Duplicate should be invalid
311- Assert . Throws < ArgumentException > ( ( ) => cloned . AsSpan ( ) ) ;
311+ _ = Assert . Throws < ArgumentException > ( ( ) => cloned . AsSpan ( ) ) ;
312312 }
313313
314314 /// <summary>
@@ -328,7 +328,7 @@ public void Duplicate_DisposingOriginal_DoesNotAffectDuplicate()
328328 Assert . Equal ( "Another Independence Test" , cloned . ToString ( ) ) ;
329329
330330 // Original should be invalid
331- Assert . Throws < ArgumentException > ( ( ) => original . AsSpan ( ) ) ;
331+ _ = Assert . Throws < ArgumentException > ( ( ) => original . AsSpan ( ) ) ;
332332 }
333333
334334 /// <summary>
@@ -377,7 +377,7 @@ public void Duplicate_MultipleDuplicates_AllIndependent()
377377 // Disposing any one shouldn't affect the others
378378 clone1 . Dispose ( ) ;
379379 Assert . Equal ( "Multi Duplicate Test" , original . ToString ( ) ) ;
380- Assert . Throws < ArgumentException > ( ( ) => clone1 . AsSpan ( ) ) ;
380+ _ = Assert . Throws < ArgumentException > ( ( ) => clone1 . AsSpan ( ) ) ;
381381 Assert . Equal ( "Multi Duplicate Test" , clone2 . ToString ( ) ) ;
382382 Assert . Equal ( "Multi Duplicate Test" , clone3 . ToString ( ) ) ;
383383 }
@@ -403,7 +403,7 @@ public void Duplicate_VsAssignment_DifferentBehavior()
403403 original . Dispose ( ) ;
404404
405405 // Assigned copy is now invalid (shared allocation was freed)
406- Assert . Throws < ArgumentException > ( ( ) => assignedCopy . AsSpan ( ) ) ;
406+ _ = Assert . Throws < ArgumentException > ( ( ) => assignedCopy . AsSpan ( ) ) ;
407407
408408 // Duplicated copy is still valid (has its own allocation)
409409 Assert . Equal ( "Compare Behaviors" , clonedCopy . ToString ( ) ) ;
@@ -422,7 +422,7 @@ public void Duplicate_DisposedPool_ThrowsObjectDisposedException()
422422 pool . Dispose ( ) ;
423423
424424 // Duplicate should throw ObjectDisposedException
425- Assert . Throws < ObjectDisposedException > ( ( ) => str . Duplicate ( ) ) ;
425+ _ = Assert . Throws < ObjectDisposedException > ( ( ) => str . Duplicate ( ) ) ;
426426 }
427427
428428 /// <summary>
@@ -443,7 +443,7 @@ public void Duplicate_LargeString_WorksCorrectly()
443443
444444 // Both should be independent
445445 original . Dispose ( ) ;
446- Assert . Throws < ArgumentException > ( ( ) => original . AsSpan ( ) ) ;
446+ _ = Assert . Throws < ArgumentException > ( ( ) => original . AsSpan ( ) ) ;
447447 Assert . Equal ( largeContent , cloned . ToString ( ) ) ;
448448 }
449449}
0 commit comments