Skip to content

Commit 7122a69

Browse files
author
github-actions
committed
chore: format code with dotnet format
1 parent 7db0546 commit 7122a69

3 files changed

Lines changed: 20 additions & 23 deletions

File tree

test/Hyperbee.Expressions.Tests/BlockAsyncSwitchTests.cs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Hyperbee.Expressions.Tests;
77
[TestClass]
88
public class BlockAsyncSwitchTests
99
{
10-
[DataTestMethod]
10+
[TestMethod]
1111
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
1212
[DataRow( CompleterType.Immediate, CompilerType.System )]
1313
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -39,7 +39,7 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithAwaitInSwitchValue( Com
3939
Assert.AreEqual( 10, result ); // Awaited switch value should match the first case
4040
}
4141

42-
[DataTestMethod]
42+
[TestMethod]
4343
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
4444
[DataRow( CompleterType.Immediate, CompilerType.System )]
4545
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -71,7 +71,7 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithAwaitInDefaultBody( Com
7171
Assert.AreEqual( 99, result ); // Default body should return 99
7272
}
7373

74-
[DataTestMethod]
74+
[TestMethod]
7575
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
7676
[DataRow( CompleterType.Immediate, CompilerType.System )]
7777
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -106,7 +106,7 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithAwaitInSwitchCaseBody(
106106
Assert.AreEqual( 100, result ); // Case 1 body should be awaited and return 100
107107
}
108108

109-
[DataTestMethod]
109+
[TestMethod]
110110
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
111111
[DataRow( CompleterType.Immediate, CompilerType.System )]
112112
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -141,7 +141,7 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithAwaitInSwitchValueAndCa
141141
Assert.AreEqual( 50, result ); // Case 2 body should be awaited and return 50
142142
}
143143

144-
[DataTestMethod]
144+
[TestMethod]
145145
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
146146
[DataRow( CompleterType.Immediate, CompilerType.System )]
147147
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -182,14 +182,13 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithNestedSwitchesAndAwaits
182182
Assert.AreEqual( 30, result ); // First case of nested switch should return 30
183183
}
184184

185-
[DataTestMethod]
185+
[TestMethod]
186186
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
187187
[DataRow( CompleterType.Immediate, CompilerType.System )]
188188
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
189189
[DataRow( CompleterType.Deferred, CompilerType.Fast )]
190190
[DataRow( CompleterType.Deferred, CompilerType.System )]
191191
[DataRow( CompleterType.Deferred, CompilerType.Interpret )]
192-
[ExpectedException( typeof( ArgumentException ) )]
193192
public async Task AsyncBlock_ShouldThrowException_WithAwaitInSwitchCaseTestValues( CompleterType completer, CompilerType compiler )
194193
{
195194
// Arrange: Switch case test values cannot contain awaited tasks
@@ -211,10 +210,10 @@ public async Task AsyncBlock_ShouldThrowException_WithAwaitInSwitchCaseTestValue
211210
var compiledLambda = lambda.Compile( compiler );
212211

213212
// Act
214-
await compiledLambda();
213+
await Assert.ThrowsExactlyAsync<ArgumentException>( async () => await compiledLambda() );
215214
}
216215

217-
[DataTestMethod]
216+
[TestMethod]
218217
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
219218
[DataRow( CompleterType.Immediate, CompilerType.System )]
220219
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -249,7 +248,7 @@ public async Task AsyncBlock_ShouldUseAwaitedValue_WithComplexExpressionInSwitch
249248
Assert.AreEqual( 10, result ); // Matching case with complex awaited value should return 10
250249
}
251250

252-
[DataTestMethod]
251+
[TestMethod]
253252
[DataRow( CompilerType.Fast )]
254253
[DataRow( CompilerType.System )]
255254
[DataRow( CompilerType.Interpret )]
@@ -276,7 +275,7 @@ public async Task AsyncBlock_ShouldHandleTaskDelaySuccessfully_InSwitchCase( Com
276275
Assert.AreEqual( 100, result ); // Awaiting a delayed task should return 100 after completion
277276
}
278277

279-
[DataTestMethod]
278+
[TestMethod]
280279
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
281280
[DataRow( CompleterType.Immediate, CompilerType.System )]
282281
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]

test/Hyperbee.Expressions.Tests/StringFormatExpressionTests.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Hyperbee.Expressions.Tests;
77
public class StringFormatExpressionTests
88
{
99

10-
[DataTestMethod]
10+
[TestMethod]
1111
[DataRow( CompilerType.Fast )]
1212
[DataRow( CompilerType.System )]
1313
[DataRow( CompilerType.Interpret )]
@@ -26,7 +26,7 @@ public void StringFormatExpression_Should_Return_Format_When_No_Arguments( Compi
2626
Assert.AreEqual( "Hello, world!", result, "Should return the format string when no arguments are provided." );
2727
}
2828

29-
[DataTestMethod]
29+
[TestMethod]
3030
[DataRow( CompilerType.Fast )]
3131
[DataRow( CompilerType.System )]
3232
[DataRow( CompilerType.Interpret )]
@@ -48,19 +48,18 @@ public void StringFormatExpression_Should_Format_String_With_Arguments( Compiler
4848
}
4949

5050
[TestMethod]
51-
[ExpectedException( typeof( ArgumentException ) )]
5251
public void StringFormatExpression_Should_Throw_If_Format_Is_Not_String()
5352
{
5453
// Arrange
5554
var invalidFormat = Expression.Constant( 42 );
5655

5756
// Act
58-
_ = ExpressionExtensions.StringFormat( invalidFormat, Expression.Constant( 10 ) );
57+
Assert.ThrowsExactly<ArgumentException>( () => _ = ExpressionExtensions.StringFormat( invalidFormat, Expression.Constant( 10 ) ) );
5958

6059
// Assert: Exception is expected
6160
}
6261

63-
[DataTestMethod]
62+
[TestMethod]
6463
[DataRow( CompilerType.Fast )]
6564
[DataRow( CompilerType.System )]
6665
[DataRow( CompilerType.Interpret )]

test/Hyperbee.Expressions.Tests/UsingExpressionTests.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public void Initialize()
3131
}
3232

3333

34-
[DataTestMethod]
34+
[TestMethod]
3535
[DataRow( CompilerType.Fast )]
3636
[DataRow( CompilerType.System )]
3737
[DataRow( CompilerType.Interpret )]
@@ -57,7 +57,7 @@ public void UsingExpression_ShouldDisposeResource_AfterUse( CompilerType compile
5757
Assert.IsTrue( resource.IsDisposed, "Resource should be disposed after using the expression." );
5858
}
5959

60-
[DataTestMethod]
60+
[TestMethod]
6161
[DataRow( CompilerType.Fast )]
6262
[DataRow( CompilerType.System )]
6363
[DataRow( CompilerType.Interpret )]
@@ -85,7 +85,7 @@ public void UsingExpression_ShouldExecuteBodyExpression( CompilerType compiler )
8585
Assert.IsTrue( _wasBodyExecuted, "The body expression should be executed." );
8686
}
8787

88-
[DataTestMethod]
88+
[TestMethod]
8989
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
9090
[DataRow( CompleterType.Immediate, CompilerType.System )]
9191
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -114,7 +114,7 @@ public async Task UsingExpression_ShouldExecuteAsyncExpression( CompleterType co
114114
Assert.AreEqual( 10, result );
115115
}
116116

117-
[DataTestMethod]
117+
[TestMethod]
118118
[DataRow( CompleterType.Immediate, CompilerType.Fast )]
119119
[DataRow( CompleterType.Immediate, CompilerType.System )]
120120
[DataRow( CompleterType.Immediate, CompilerType.Interpret )]
@@ -145,20 +145,19 @@ public async Task UsingExpression_ShouldExecuteAsyncExpression_WithInnerUsing( C
145145
}
146146

147147
[TestMethod]
148-
[ExpectedException( typeof( ArgumentException ) )]
149148
public void UsingExpression_ShouldThrowArgumentException_WhenNonDisposableUsed()
150149
{
151150
// Arrange
152151
var nonDisposableExpression = Constant( "non-disposable string" );
153152

154153
// Act
155-
Using( nonDisposableExpression, Empty() );
154+
Assert.ThrowsExactly<ArgumentException>( () => Using( nonDisposableExpression, Empty() ) );
156155

157156
// Assert: Expect an ArgumentException due to non-disposable resource
158157
// The constructor should throw the exception, no need for further assertions
159158
}
160159

161-
[DataTestMethod]
160+
[TestMethod]
162161
[DataRow( CompilerType.Fast )]
163162
[DataRow( CompilerType.System )]
164163
[DataRow( CompilerType.Interpret )]

0 commit comments

Comments
 (0)