@@ -9,7 +9,7 @@ namespace Hyperbee.Expressions.Tests;
99[ TestClass ]
1010public class BlockAsyncBasicTests
1111{
12- [ TestMethod ]
12+ [ DataTestMethod ]
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- [ TestMethod ]
39+ [ DataTestMethod ]
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- [ TestMethod ]
70+ [ DataTestMethod ]
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- [ TestMethod ]
89+ [ DataTestMethod ]
9090 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
9191 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
9292 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -117,10 +117,11 @@ public async Task BlockAsync_ShouldAwaitMultipleTasks_WithDifferentResults( Comp
117117 Assert . AreEqual ( 2 , result ) ; // Last awaited result should be returned
118118 }
119119
120- [ TestMethod ]
120+ [ DataTestMethod ]
121121 [ DataRow ( CompilerType . Fast ) ]
122122 [ DataRow ( CompilerType . System ) ]
123123 [ DataRow ( CompilerType . Interpret ) ]
124+ [ ExpectedException ( typeof ( InvalidOperationException ) ) ]
124125 public async Task BlockAsync_ShouldThrowException_WithFaultedTask ( CompilerType compiler )
125126 {
126127 // Arrange
@@ -132,13 +133,14 @@ public async Task BlockAsync_ShouldThrowException_WithFaultedTask( CompilerType
132133 var compiledLambda = lambda . Compile ( compiler ) ;
133134
134135 // Act & Assert
135- await Assert . ThrowsExactlyAsync < InvalidOperationException > ( async ( ) => await compiledLambda ( ) ) ;
136+ await compiledLambda ( ) ;
136137 }
137138
138- [ TestMethod ]
139+ [ DataTestMethod ]
139140 [ DataRow ( CompilerType . Fast ) ]
140141 [ DataRow ( CompilerType . System ) ]
141142 [ DataRow ( CompilerType . Interpret ) ]
143+ [ ExpectedException ( typeof ( TaskCanceledException ) ) ]
142144 public async Task BlockAsync_ShouldHandleCanceledTask_WithCancellation ( CompilerType compiler )
143145 {
144146 // Arrange
@@ -151,10 +153,10 @@ public async Task BlockAsync_ShouldHandleCanceledTask_WithCancellation( Compiler
151153 var compiledLambda = lambda . Compile ( compiler ) ;
152154
153155 // Act & Assert
154- await Assert . ThrowsExactlyAsync < TaskCanceledException > ( async ( ) => await compiledLambda ( ) ) ;
156+ await compiledLambda ( ) ;
155157 }
156158
157- [ TestMethod ]
159+ [ DataTestMethod ]
158160 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
159161 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
160162 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -182,7 +184,7 @@ public async Task BlockAsync_ShouldAwaitNestedBlockAsync_WithNestedTasks( Comple
182184 Assert . AreEqual ( 2 , result ) ;
183185 }
184186
185- [ TestMethod ]
187+ [ DataTestMethod ]
186188 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
187189 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
188190 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -213,7 +215,7 @@ public async Task BlockAsync_ShouldAwaitNestedBlockAsync_WithNestedLambdas( Comp
213215 Assert . AreEqual ( 2 , result ) ;
214216 }
215217
216- [ TestMethod ]
218+ [ DataTestMethod ]
217219 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
218220 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
219221 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -259,7 +261,7 @@ public async Task BlockAsync_ShouldShareVariablesBetweenBlocks_WithNestedAwaits(
259261 Assert . AreEqual ( 7 , result ) ;
260262 }
261263
262- [ TestMethod ]
264+ [ DataTestMethod ]
263265 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
264266 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
265267 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -283,7 +285,7 @@ public async Task BlockAsync_ShouldHandleSyncAndAsync_WithMixedOperations( Compl
283285 Assert . AreEqual ( 20 , result ) ; // The last operation is asynchronous and returns 20
284286 }
285287
286- [ TestMethod ]
288+ [ DataTestMethod ]
287289 [ DataRow ( CompilerType . Fast ) ]
288290 [ DataRow ( CompilerType . System ) ]
289291 [ DataRow ( CompilerType . Interpret ) ]
@@ -301,7 +303,7 @@ public async Task BlockAsync_ShouldAwaitSuccessfully_WithTask( CompilerType comp
301303 Assert . IsTrue ( true ) ; // If no exception, the test is successful
302304 }
303305
304- [ TestMethod ]
306+ [ DataTestMethod ]
305307 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
306308 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
307309 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -331,7 +333,7 @@ public async Task BlockAsync_ShouldAwaitSuccessfully_WithReturnLabel( CompleterT
331333 Assert . AreEqual ( 10 , result ) ; // The last operation is asynchronous and returns 10
332334 }
333335
334- [ TestMethod ]
336+ [ DataTestMethod ]
335337 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
336338 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
337339 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -363,7 +365,7 @@ public async Task BlockAsync_ShouldPreserveVariableAssignment_BeforeAndAfterAwai
363365 Assert . AreEqual ( 15 , result ) ;
364366 }
365367
366- [ TestMethod ]
368+ [ DataTestMethod ]
367369 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
368370 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
369371 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -414,7 +416,7 @@ public async Task BlockAsync_ShouldPreserveVariablesInNestedBlock_WithAwaits( Co
414416 Assert . AreEqual ( 255 , result ) ;
415417 }
416418
417- [ TestMethod ]
419+ [ DataTestMethod ]
418420 [ DataRow ( CompilerType . Fast ) ]
419421 [ DataRow ( CompilerType . System ) ]
420422 [ DataRow ( CompilerType . Interpret ) ]
@@ -452,7 +454,7 @@ public async Task BlockAsync_ShouldPreserveVariables_WithNestedAwaits( CompilerT
452454 Assert . AreEqual ( 10 , result ) ;
453455 }
454456
455- [ TestMethod ]
457+ [ DataTestMethod ]
456458 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
457459 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
458460 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -498,7 +500,7 @@ public async Task BlockAsync_ShouldAllowLambdaParameters( CompleterType complete
498500 Assert . AreEqual ( 15 , result ) ;
499501 }
500502
501- [ TestMethod ]
503+ [ DataTestMethod ]
502504 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
503505 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
504506 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -559,7 +561,7 @@ public async Task BlockAsync_ShouldAllowParallelBlocks_WithTaskWhenAll( Complete
559561 }
560562 }
561563
562- [ TestMethod ]
564+ [ DataTestMethod ]
563565 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
564566 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
565567 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -611,7 +613,7 @@ public async Task BlockAsync_ShouldAllowNestedBlocks_WithoutAsync( CompleterType
611613 Assert . AreEqual ( 7 , result ) ;
612614 }
613615
614- [ TestMethod ]
616+ [ DataTestMethod ]
615617 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
616618 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
617619 [ DataRow ( CompleterType . Immediate , CompilerType . Interpret ) ]
@@ -665,7 +667,7 @@ public void Dispose()
665667 }
666668 }
667669
668- [ TestMethod ]
670+ [ DataTestMethod ]
669671 [ DataRow ( CompleterType . Immediate , CompilerType . Fast ) ]
670672 [ DataRow ( CompleterType . Immediate , CompilerType . System ) ]
671673 [ DataRow ( CompleterType . Deferred , CompilerType . Fast ) ]
0 commit comments