@@ -9,7 +9,7 @@ namespace Hyperbee.Expressions.Tests;
99[ TestClass ]
1010public class BlockAsyncBasicTests
1111{
12- [ DataTestMethod ]
12+ [ TestMethod ]
1313 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
1414 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
1515 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -36,7 +36,7 @@ public async Task BlockAsync_ShouldAwaitSuccessfully_WithCompletedTask( Complete
3636 Assert . AreEqual ( 1 , result ) ;
3737 }
3838
39- [ DataTestMethod ]
39+ [ TestMethod ]
4040 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
4141 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
4242 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -67,7 +67,7 @@ public async Task BlockAsync_ShouldAwaitMultipleSuccessfully_WithCompletedTask(
6767 Assert . AreEqual ( 2 , result ) ;
6868 }
6969
70- [ DataTestMethod ]
70+ [ TestMethod ]
7171 [ DataRow ( CompilerType . Fast ) ]
7272 [ DataRow ( CompilerType . System ) ]
7373 [ DataRow ( CompilerType . Interpret ) ]
@@ -86,7 +86,7 @@ public async Task BlockAsync_ShouldAwaitSuccessfully_WithDelayedTask( CompilerTy
8686 Assert . AreEqual ( 5 , result ) ;
8787 }
8888
89- [ DataTestMethod ]
89+ [ TestMethod ]
9090 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
9191 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
9292 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -117,11 +117,10 @@ public async Task BlockAsync_ShouldAwaitMultipleTasks_WithDifferentResults( Comp
117117 Assert . AreEqual ( 2 , result ) ; // Last awaited result should be returned
118118 }
119119
120- [ DataTestMethod ]
120+ [ TestMethod ]
121121 [ DataRow ( CompilerType . Fast ) ]
122122 [ DataRow ( CompilerType . System ) ]
123123 [ DataRow ( CompilerType . Interpret ) ]
124- [ ExpectedException ( typeof ( InvalidOperationException ) ) ]
125124 public async Task BlockAsync_ShouldThrowException_WithFaultedTask ( CompilerType compiler )
126125 {
127126 // Arrange
@@ -133,14 +132,13 @@ public async Task BlockAsync_ShouldThrowException_WithFaultedTask( CompilerType
133132 var compiledLambda = lambda . Compile ( compiler ) ;
134133
135134 // Act & Assert
136- await compiledLambda ( ) ;
135+ await Assert . ThrowsExactlyAsync < InvalidOperationException > ( async ( ) => await compiledLambda ( ) ) ;
137136 }
138137
139- [ DataTestMethod ]
138+ [ TestMethod ]
140139 [ DataRow ( CompilerType . Fast ) ]
141140 [ DataRow ( CompilerType . System ) ]
142141 [ DataRow ( CompilerType . Interpret ) ]
143- [ ExpectedException ( typeof ( TaskCanceledException ) ) ]
144142 public async Task BlockAsync_ShouldHandleCanceledTask_WithCancellation ( CompilerType compiler )
145143 {
146144 // Arrange
@@ -153,10 +151,10 @@ public async Task BlockAsync_ShouldHandleCanceledTask_WithCancellation( Compiler
153151 var compiledLambda = lambda . Compile ( compiler ) ;
154152
155153 // Act & Assert
156- await compiledLambda ( ) ;
154+ await Assert . ThrowsExactlyAsync < TaskCanceledException > ( async ( ) => await compiledLambda ( ) ) ;
157155 }
158156
159- [ DataTestMethod ]
157+ [ TestMethod ]
160158 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
161159 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
162160 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -184,7 +182,7 @@ public async Task BlockAsync_ShouldAwaitNestedBlockAsync_WithNestedTasks( Comple
184182 Assert . AreEqual ( 2 , result ) ;
185183 }
186184
187- [ DataTestMethod ]
185+ [ TestMethod ]
188186 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
189187 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
190188 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -215,7 +213,7 @@ public async Task BlockAsync_ShouldAwaitNestedBlockAsync_WithNestedLambdas( Comp
215213 Assert . AreEqual ( 2 , result ) ;
216214 }
217215
218- [ DataTestMethod ]
216+ [ TestMethod ]
219217 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
220218 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
221219 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -261,7 +259,7 @@ public async Task BlockAsync_ShouldShareVariablesBetweenBlocks_WithNestedAwaits(
261259 Assert . AreEqual ( 7 , result ) ;
262260 }
263261
264- [ DataTestMethod ]
262+ [ TestMethod ]
265263 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
266264 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
267265 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -285,7 +283,7 @@ public async Task BlockAsync_ShouldHandleSyncAndAsync_WithMixedOperations( Compl
285283 Assert . AreEqual ( 20 , result ) ; // The last operation is asynchronous and returns 20
286284 }
287285
288- [ DataTestMethod ]
286+ [ TestMethod ]
289287 [ DataRow ( CompilerType . Fast ) ]
290288 [ DataRow ( CompilerType . System ) ]
291289 [ DataRow ( CompilerType . Interpret ) ]
@@ -303,7 +301,7 @@ public async Task BlockAsync_ShouldAwaitSuccessfully_WithTask( CompilerType comp
303301 Assert . IsTrue ( true ) ; // If no exception, the test is successful
304302 }
305303
306- [ DataTestMethod ]
304+ [ TestMethod ]
307305 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
308306 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
309307 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -333,7 +331,7 @@ public async Task BlockAsync_ShouldAwaitSuccessfully_WithReturnLabel( CompleterT
333331 Assert . AreEqual ( 10 , result ) ; // The last operation is asynchronous and returns 10
334332 }
335333
336- [ DataTestMethod ]
334+ [ TestMethod ]
337335 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
338336 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
339337 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -365,7 +363,7 @@ public async Task BlockAsync_ShouldPreserveVariableAssignment_BeforeAndAfterAwai
365363 Assert . AreEqual ( 15 , result ) ;
366364 }
367365
368- [ DataTestMethod ]
366+ [ TestMethod ]
369367 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
370368 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
371369 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -416,7 +414,7 @@ public async Task BlockAsync_ShouldPreserveVariablesInNestedBlock_WithAwaits( Co
416414 Assert . AreEqual ( 255 , result ) ;
417415 }
418416
419- [ DataTestMethod ]
417+ [ TestMethod ]
420418 [ DataRow ( CompilerType . Fast ) ]
421419 [ DataRow ( CompilerType . System ) ]
422420 [ DataRow ( CompilerType . Interpret ) ]
@@ -454,7 +452,7 @@ public async Task BlockAsync_ShouldPreserveVariables_WithNestedAwaits( CompilerT
454452 Assert . AreEqual ( 10 , result ) ;
455453 }
456454
457- [ DataTestMethod ]
455+ [ TestMethod ]
458456 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
459457 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
460458 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -500,7 +498,7 @@ public async Task BlockAsync_ShouldAllowLambdaParameters( CompleterType complete
500498 Assert . AreEqual ( 15 , result ) ;
501499 }
502500
503- [ DataTestMethod ]
501+ [ TestMethod ]
504502 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
505503 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
506504 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -561,7 +559,7 @@ public async Task BlockAsync_ShouldAllowParallelBlocks_WithTaskWhenAll( Complete
561559 }
562560 }
563561
564- [ DataTestMethod ]
562+ [ TestMethod ]
565563 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
566564 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
567565 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -613,7 +611,7 @@ public async Task BlockAsync_ShouldAllowNestedBlocks_WithoutAsync( CompleterType
613611 Assert . AreEqual ( 7 , result ) ;
614612 }
615613
616- [ DataTestMethod ]
614+ [ TestMethod ]
617615 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
618616 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
619617 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -667,7 +665,7 @@ public void Dispose()
667665 }
668666 }
669667
670- [ DataTestMethod ]
668+ [ TestMethod ]
671669 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
672670 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
673671 [ DataRow ( CompleterType . Deferred , CompilerType . Fast ) ]
0 commit comments