diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml
deleted file mode 100644
index 3adcfc2..0000000
--- a/.github/workflows/format.yml
+++ /dev/null
@@ -1,52 +0,0 @@
-name: Format
-
-on:
- push:
- workflow_dispatch:
- pull_request:
- types: [opened, edited, synchronize, reopened]
- branches: [main, develop]
-
- workflow_run:
- workflows: [Create Prerelease, Create Release]
- types: [requested]
-
-permissions:
- contents: write
- pull-requests: write
- actions: read
-
-jobs:
- discover:
- runs-on: ubuntu-latest
- outputs:
- branch_name: ${{ steps.set_branch.outputs.branch_name }}
-
- steps:
- - id: set_branch
- shell: bash
- run: |
- # 1. Pick the raw branch/ref for each trigger type
- if [[ "${{ github.event_name }}" == "workflow_run" ]]; then
- RAW='${{ github.event.workflow_run.head_branch }}'
- elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
- RAW='${{ github.event.pull_request.base.ref }}'
- else
- RAW='${{ github.ref }}'
- fi
-
- # 2. Strip the refs/heads/ prefix if present
- CLEAN="${RAW#refs/heads/}"
-
- echo "Detected branch: $CLEAN"
- echo "branch_name=$CLEAN" >> "$GITHUB_OUTPUT"
-
- format:
- needs: discover
- if: ${{ needs.discover.result == 'success' }}
- uses: Stillpoint-Software/shared-workflows/.github/workflows/format.yml@main
- with:
- dotnet_version: "9.0.x"
- branch: ${{ needs.discover.outputs.branch_name }}
- secrets: inherit
-
diff --git a/Directory.Build.props b/Directory.Build.props
index 2256d66..257ab3a 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -10,7 +10,6 @@
runtime; build; native; contentfiles; analyzers; buildtransitive
-
diff --git a/Hyperbee.Expressions.sln b/Hyperbee.Expressions.sln
index ae8425d..0776c78 100644
--- a/Hyperbee.Expressions.sln
+++ b/Hyperbee.Expressions.sln
@@ -22,7 +22,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
.github\workflows\create_release.yml = .github\workflows\create_release.yml
.github\workflows\create_test_report.yml = .github\workflows\create_test_report.yml
.github\workflows\deploy-gh-pages.yml = .github\workflows\deploy-gh-pages.yml
- .github\workflows\format.yml = .github\workflows\format.yml
.github\workflows\issue_branch.yml = .github\workflows\issue_branch.yml
.github\workflows\pack_publish.yml = .github\workflows\pack_publish.yml
.github\workflows\run_tests.yml = .github\workflows\run_tests.yml
diff --git a/src/Hyperbee.Expressions.Lab/Hyperbee.Expressions.Lab.csproj b/src/Hyperbee.Expressions.Lab/Hyperbee.Expressions.Lab.csproj
index a205962..056a7f3 100644
--- a/src/Hyperbee.Expressions.Lab/Hyperbee.Expressions.Lab.csproj
+++ b/src/Hyperbee.Expressions.Lab/Hyperbee.Expressions.Lab.csproj
@@ -47,9 +47,9 @@
-
+
all
diff --git a/test/Hyperbee.Expressions.Benchmark/Hyperbee.Expressions.Benchmark.csproj b/test/Hyperbee.Expressions.Benchmark/Hyperbee.Expressions.Benchmark.csproj
index c57bcdf..dc036ac 100644
--- a/test/Hyperbee.Expressions.Benchmark/Hyperbee.Expressions.Benchmark.csproj
+++ b/test/Hyperbee.Expressions.Benchmark/Hyperbee.Expressions.Benchmark.csproj
@@ -11,7 +11,7 @@
-
+
diff --git a/test/Hyperbee.Expressions.Tests/BlockAsyncBasicTests.cs b/test/Hyperbee.Expressions.Tests/BlockAsyncBasicTests.cs
index 8738b47..640900c 100644
--- a/test/Hyperbee.Expressions.Tests/BlockAsyncBasicTests.cs
+++ b/test/Hyperbee.Expressions.Tests/BlockAsyncBasicTests.cs
@@ -121,6 +121,7 @@ public async Task BlockAsync_ShouldAwaitMultipleTasks_WithDifferentResults( Comp
[DataRow( CompilerType.Fast )]
[DataRow( CompilerType.System )]
[DataRow( CompilerType.Interpret )]
+ [ExpectedException( typeof( InvalidOperationException ) )]
public async Task BlockAsync_ShouldThrowException_WithFaultedTask( CompilerType compiler )
{
// Arrange
@@ -132,13 +133,14 @@ public async Task BlockAsync_ShouldThrowException_WithFaultedTask( CompilerType
var compiledLambda = lambda.Compile( compiler );
// Act & Assert
- await Assert.ThrowsExactlyAsync( async () => await compiledLambda() );
+ await compiledLambda();
}
[TestMethod]
[DataRow( CompilerType.Fast )]
[DataRow( CompilerType.System )]
[DataRow( CompilerType.Interpret )]
+ [ExpectedException( typeof( TaskCanceledException ) )]
public async Task BlockAsync_ShouldHandleCanceledTask_WithCancellation( CompilerType compiler )
{
// Arrange
@@ -151,7 +153,7 @@ public async Task BlockAsync_ShouldHandleCanceledTask_WithCancellation( Compiler
var compiledLambda = lambda.Compile( compiler );
// Act & Assert
- await Assert.ThrowsExactlyAsync( async () => await compiledLambda() );
+ await compiledLambda();
}
[TestMethod]
diff --git a/test/Hyperbee.Expressions.Tests/BlockAsyncConditionalTests.cs b/test/Hyperbee.Expressions.Tests/BlockAsyncConditionalTests.cs
index 1583dfc..b497355 100644
--- a/test/Hyperbee.Expressions.Tests/BlockAsyncConditionalTests.cs
+++ b/test/Hyperbee.Expressions.Tests/BlockAsyncConditionalTests.cs
@@ -370,6 +370,7 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithConditionalReturningTas
}
[TestMethod]
+ [ExpectedException( typeof( NullReferenceException ) )]
public async Task AsyncBlock_ShouldThrowException_WithNullTaskInConditional()
{
// Arrange: One of the branches returns a null task, leading to exception
@@ -384,6 +385,6 @@ public async Task AsyncBlock_ShouldThrowException_WithNullTaskInConditional()
var compiledLambda = lambda.Compile();
// Act & Assert
- await Assert.ThrowsExactlyAsync( async () => await compiledLambda() );
+ await compiledLambda();
}
}
diff --git a/test/Hyperbee.Expressions.Tests/BlockAsyncSwitchTests.cs b/test/Hyperbee.Expressions.Tests/BlockAsyncSwitchTests.cs
index 4fe26af..a05f24b 100644
--- a/test/Hyperbee.Expressions.Tests/BlockAsyncSwitchTests.cs
+++ b/test/Hyperbee.Expressions.Tests/BlockAsyncSwitchTests.cs
@@ -189,6 +189,7 @@ public async Task AsyncBlock_ShouldAwaitSuccessfully_WithNestedSwitchesAndAwaits
[DataRow( CompleterType.Deferred, CompilerType.Fast )]
[DataRow( CompleterType.Deferred, CompilerType.System )]
[DataRow( CompleterType.Deferred, CompilerType.Interpret )]
+ [ExpectedException( typeof( ArgumentException ) )]
public async Task AsyncBlock_ShouldThrowException_WithAwaitInSwitchCaseTestValues( CompleterType completer, CompilerType compiler )
{
// Arrange: Switch case test values cannot contain awaited tasks
@@ -210,7 +211,7 @@ public async Task AsyncBlock_ShouldThrowException_WithAwaitInSwitchCaseTestValue
var compiledLambda = lambda.Compile( compiler );
// Act
- await Assert.ThrowsExactlyAsync( async () => await compiledLambda() );
+ await compiledLambda();
}
[TestMethod]
diff --git a/test/Hyperbee.Expressions.Tests/BlockYieldBasicTests.cs b/test/Hyperbee.Expressions.Tests/BlockYieldBasicTests.cs
index 61ff45f..93c667a 100644
--- a/test/Hyperbee.Expressions.Tests/BlockYieldBasicTests.cs
+++ b/test/Hyperbee.Expressions.Tests/BlockYieldBasicTests.cs
@@ -44,7 +44,7 @@ public void BlockYield_ShouldYieldSuccessfully( CompilerType compiler )
https://github.com/dotnet/runtime/issues/114081
======================================================================
- [DataTestMethod]
+ [TestMethod]
[DataRow( false )]
[DataRow( true )]
public void TryFault_ShouldRunSuccessfully_WithReturnLabel( bool interpret )
@@ -75,7 +75,7 @@ public void TryFault_ShouldRunSuccessfully_WithReturnLabel( bool interpret )
Assert.AreEqual( 1, result );
}
- [DataTestMethod]
+ [TestMethod]
[DataRow( false )]
[DataRow( true )]
public void TryFault_ShouldRunSuccessfully_WithReturnLabel_Workaround( bool interpret )
diff --git a/test/Hyperbee.Expressions.Tests/DebugExpressionTests.cs b/test/Hyperbee.Expressions.Tests/DebugExpressionTests.cs
index 0160862..465b551 100644
--- a/test/Hyperbee.Expressions.Tests/DebugExpressionTests.cs
+++ b/test/Hyperbee.Expressions.Tests/DebugExpressionTests.cs
@@ -96,6 +96,7 @@ public void DebugExpression_Should_Not_Invoke_DebugDelegate_When_Condition_Is_Fa
}
[TestMethod]
+ [ExpectedException( typeof( ArgumentException ) )]
public void DebugExpression_Should_Throw_If_Condition_Is_Not_Boolean()
{
// Arrange
@@ -106,7 +107,7 @@ static void DebugAction( int value )
var invalidCondition = Constant( 42 );
// Act
- Assert.ThrowsExactly( () => _ = Debug( DebugAction, invalidCondition, Constant( 10 ) ) );
+ _ = Debug( DebugAction, invalidCondition, Constant( 10 ) );
// Assert: Exception is expected
}
diff --git a/test/Hyperbee.Expressions.Tests/Hyperbee.Expressions.Tests.csproj b/test/Hyperbee.Expressions.Tests/Hyperbee.Expressions.Tests.csproj
index 7d078b1..cdb6a9c 100644
--- a/test/Hyperbee.Expressions.Tests/Hyperbee.Expressions.Tests.csproj
+++ b/test/Hyperbee.Expressions.Tests/Hyperbee.Expressions.Tests.csproj
@@ -17,15 +17,15 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
-
-
+
+
diff --git a/test/Hyperbee.Expressions.Tests/InjectExpressionTests.cs b/test/Hyperbee.Expressions.Tests/InjectExpressionTests.cs
index f738aaa..58c8469 100644
--- a/test/Hyperbee.Expressions.Tests/InjectExpressionTests.cs
+++ b/test/Hyperbee.Expressions.Tests/InjectExpressionTests.cs
@@ -82,6 +82,7 @@ public void InjectExpression_ShouldInjectSuccessfully_WithKeyedFallback( Compile
[DataRow( CompilerType.Fast )]
[DataRow( CompilerType.System )]
[DataRow( CompilerType.Interpret )]
+ [ExpectedException( typeof( InvalidOperationException ), "Service is not available." )]
public void InjectExpression_ShouldInjectSuccessfully_WithBadKey( CompilerType compiler )
{
// Arrange
@@ -95,7 +96,7 @@ public void InjectExpression_ShouldInjectSuccessfully_WithBadKey( CompilerType c
var lambda = Lambda>( block );
var compiledLambda = lambda.Compile( compiler );
- Assert.ThrowsExactly( () => compiledLambda() );
+ compiledLambda();
}
[TestMethod]
diff --git a/test/Hyperbee.Expressions.Tests/StringFormatExpressionTests.cs b/test/Hyperbee.Expressions.Tests/StringFormatExpressionTests.cs
index 7a374e4..f924d7f 100644
--- a/test/Hyperbee.Expressions.Tests/StringFormatExpressionTests.cs
+++ b/test/Hyperbee.Expressions.Tests/StringFormatExpressionTests.cs
@@ -48,13 +48,14 @@ public void StringFormatExpression_Should_Format_String_With_Arguments( Compiler
}
[TestMethod]
+ [ExpectedException( typeof( ArgumentException ) )]
public void StringFormatExpression_Should_Throw_If_Format_Is_Not_String()
{
// Arrange
var invalidFormat = Expression.Constant( 42 );
// Act
- Assert.ThrowsExactly( () => _ = ExpressionExtensions.StringFormat( invalidFormat, Expression.Constant( 10 ) ) );
+ _ = ExpressionExtensions.StringFormat( invalidFormat, Expression.Constant( 10 ) );
// Assert: Exception is expected
}
diff --git a/test/Hyperbee.Expressions.Tests/UsingExpressionTests.cs b/test/Hyperbee.Expressions.Tests/UsingExpressionTests.cs
index 748624e..be89546 100644
--- a/test/Hyperbee.Expressions.Tests/UsingExpressionTests.cs
+++ b/test/Hyperbee.Expressions.Tests/UsingExpressionTests.cs
@@ -145,13 +145,14 @@ public async Task UsingExpression_ShouldExecuteAsyncExpression_WithInnerUsing( C
}
[TestMethod]
+ [ExpectedException( typeof( ArgumentException ) )]
public void UsingExpression_ShouldThrowArgumentException_WhenNonDisposableUsed()
{
// Arrange
var nonDisposableExpression = Constant( "non-disposable string" );
// Act
- Assert.ThrowsExactly( () => Using( nonDisposableExpression, Empty() ) );
+ Using( nonDisposableExpression, Empty() );
// Assert: Expect an ArgumentException due to non-disposable resource
// The constructor should throw the exception, no need for further assertions