Skip to content

Commit 6a60744

Browse files
author
github-actions
committed
chore: format code with dotnet format
1 parent 6f7be16 commit 6a60744

25 files changed

Lines changed: 162 additions & 170 deletions

test/Hyperbee.Expressions.Tests/BlockAsyncBasicTests.cs

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Hyperbee.Expressions.Tests;
99
[TestClass]
1010
public 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 )]

test/Hyperbee.Expressions.Tests/BlockAsyncConditionalTests.cs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Hyperbee.Expressions.Tests;
77
[TestClass]
88
public class BlockAsyncConditionalTests
99
{
10-
[DataTestMethod]
10+
[TestMethod]
1111
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
1212
[DataRow( CompleterType.Immediate, CompilerType.System )]
1313
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -36,7 +36,7 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithIfThenCondition( Comple
3636
Assert.IsTrue( true ); // No exception means condition and block executed successfully
3737
}
3838

39-
[DataTestMethod]
39+
[TestMethod]
4040
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
4141
[DataRow( CompleterType.Immediate, CompilerType.System )]
4242
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -72,7 +72,7 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithConditionalAssignment(
7272
Assert.AreEqual( 1, result );
7373
}
7474

75-
[DataTestMethod]
75+
[TestMethod]
7676
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
7777
[DataRow( CompleterType.Immediate, CompilerType.System )]
7878
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -102,7 +102,7 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithIfThenElseTrueBranch( C
102102
Assert.AreEqual( 1, result );
103103
}
104104

105-
[DataTestMethod]
105+
[TestMethod]
106106
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
107107
[DataRow( CompleterType.Immediate, CompilerType.System )]
108108
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -132,7 +132,7 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithIfThenElseFalseBranch(
132132
Assert.AreEqual( 2, result );
133133
}
134134

135-
[DataTestMethod]
135+
[TestMethod]
136136
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
137137
[DataRow( CompleterType.Immediate, CompilerType.System )]
138138
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -161,7 +161,7 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithConditionalInTest( Comp
161161
Assert.AreEqual( 1, result );
162162
}
163163

164-
[DataTestMethod]
164+
[TestMethod]
165165
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
166166
[DataRow( CompleterType.Immediate, CompilerType.System )]
167167
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -194,7 +194,7 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithAwaitInTrueAndFalseBran
194194
Assert.AreEqual( 10, result ); // Condition is true, so the true branch should be awaited
195195
}
196196

197-
[DataTestMethod]
197+
[TestMethod]
198198
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
199199
[DataRow( CompleterType.Immediate, CompilerType.System )]
200200
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -225,7 +225,7 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithAwaitBeforeAndAfterCond
225225
Assert.AreEqual( 15, result ); // Last awaited value should be 15
226226
}
227227

228-
[DataTestMethod]
228+
[TestMethod]
229229
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
230230
[DataRow( CompleterType.Immediate, CompilerType.System )]
231231
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -255,7 +255,7 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithFalseCondition( Complet
255255
Assert.AreEqual( 20, result ); // False branch should be awaited and return 20
256256
}
257257

258-
[DataTestMethod]
258+
[TestMethod]
259259
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
260260
[DataRow( CompleterType.Immediate, CompilerType.System )]
261261
[DataRow( CompleterType.Deferred, CompilerType.Fast )]
@@ -295,7 +295,7 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithComplexConditionalLogic
295295
Assert.AreEqual( 2, result ); // Second condition is false, so the false branch returns 2
296296
}
297297

298-
[DataTestMethod]
298+
[TestMethod]
299299
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
300300
[DataRow( CompleterType.Immediate, CompilerType.System )]
301301
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -332,7 +332,7 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithNestedConditionals( Com
332332
Assert.AreEqual( 10, result ); // The true branch contains another conditional, false branch executed
333333
}
334334

335-
[DataTestMethod]
335+
[TestMethod]
336336
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
337337
[DataRow( CompleterType.Immediate, CompilerType.System )]
338338
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -370,7 +370,6 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithConditionalReturningTas
370370
}
371371

372372
[TestMethod]
373-
[ExpectedException( typeof( NullReferenceException ) )]
374373
public async Task AsyncBlock_ShouldThrowException_WithNullTaskInConditional()
375374
{
376375
// Arrange: One of the branches returns a null task, leading to exception
@@ -385,6 +384,6 @@ public async Task AsyncBlock_ShouldThrowException_WithNullTaskInConditional()
385384
var compiledLambda = lambda.Compile();
386385

387386
// Act & Assert
388-
await compiledLambda();
387+
await Assert.ThrowsExactlyAsync<NullReferenceException>( async () => await compiledLambda() );
389388
}
390389
}

test/Hyperbee.Expressions.Tests/BlockAsyncLoopTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Hyperbee.Expressions.Tests;
77
[TestClass]
88
public class BlockAsyncLoopTests
99
{
10-
[DataTestMethod]
10+
[TestMethod]
1111
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
1212
[DataRow( CompleterType.Immediate, CompilerType.System )]
1313
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -49,7 +49,7 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithAwaitBeforeBreak( Compl
4949
Assert.AreEqual( 1, result ); // Loop should break after 1 iteration
5050
}
5151

52-
[DataTestMethod]
52+
[TestMethod]
5353
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
5454
[DataRow( CompleterType.Immediate, CompilerType.System )]
5555
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -92,7 +92,7 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithAwaitAfterLoop( Complet
9292
Assert.AreEqual( 2, result ); // Loop breaks after 2 iterations
9393
}
9494

95-
[DataTestMethod]
95+
[TestMethod]
9696
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
9797
[DataRow( CompleterType.Immediate, CompilerType.System )]
9898
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -136,7 +136,7 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithAwaitBeforeContinue( Co
136136
Assert.AreEqual( 2, result ); // Loop continues past the first iteration
137137
}
138138

139-
[DataTestMethod]
139+
[TestMethod]
140140
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
141141
[DataRow( CompleterType.Immediate, CompilerType.System )]
142142
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -180,7 +180,7 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithAwaitAfterContinue( Com
180180
Assert.AreEqual( 2, result ); // Loop processes all iterations
181181
}
182182

183-
[DataTestMethod]
183+
[TestMethod]
184184
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
185185
[DataRow( CompleterType.Immediate, CompilerType.System )]
186186
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -223,7 +223,7 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithMultipleAwaitsInLoop( C
223223
Assert.AreEqual( 1, result ); // Loop processes all iterations
224224
}
225225

226-
[DataTestMethod]
226+
[TestMethod]
227227
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
228228
[DataRow( CompleterType.Immediate, CompilerType.System )]
229229
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]

0 commit comments

Comments
 (0)