Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 0 additions & 52 deletions .github/workflows/format.yml

This file was deleted.

1 change: 0 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.14.0" />
</ItemGroup>

<!-- SourceLink / build hygiene -->
Expand Down
1 change: 0 additions & 1 deletion Hyperbee.Expressions.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
<PackageReference Include="Hyperbee.Json" Version="3.0.6" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.8" />
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.8" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.8" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.8" />
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.8" />
<ProjectReference Include="..\Hyperbee.Expressions\Hyperbee.Expressions.csproj" />
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.15.2" />
<PackageReference Include="DotNext.Metaprogramming" Version="5.23.0" />
<PackageReference Include="FastExpressionCompiler" Version="5.3.0" />
<PackageReference Include="FastExpressionCompiler" Version="5.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 4 additions & 2 deletions test/Hyperbee.Expressions.Tests/BlockAsyncBasicTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@
[DataRow( CompilerType.Fast )]
[DataRow( CompilerType.System )]
[DataRow( CompilerType.Interpret )]
[ExpectedException( typeof( InvalidOperationException ) )]
public async Task BlockAsync_ShouldThrowException_WithFaultedTask( CompilerType compiler )

Check warning on line 125 in test/Hyperbee.Expressions.Tests/BlockAsyncBasicTests.cs

View workflow job for this annotation

GitHub Actions / test / test

Prefer 'Assert.ThrowsExactly/ThrowsExactlyAsync' over '[ExpectedException]' (https://learn.microsoft.com/dotnet/core/testing/mstest-analyzers/mstest0006)
{
// Arrange
var block = BlockAsync(
Expand All @@ -132,13 +133,14 @@
var compiledLambda = lambda.Compile( compiler );

// Act & Assert
await Assert.ThrowsExactlyAsync<InvalidOperationException>( 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
Expand All @@ -151,7 +153,7 @@
var compiledLambda = lambda.Compile( compiler );

// Act & Assert
await Assert.ThrowsExactlyAsync<TaskCanceledException>( async () => await compiledLambda() );
await compiledLambda();
}

[TestMethod]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -384,6 +385,6 @@ public async Task AsyncBlock_ShouldThrowException_WithNullTaskInConditional()
var compiledLambda = lambda.Compile();

// Act & Assert
await Assert.ThrowsExactlyAsync<NullReferenceException>( async () => await compiledLambda() );
await compiledLambda();
}
}
3 changes: 2 additions & 1 deletion test/Hyperbee.Expressions.Tests/BlockAsyncSwitchTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -210,7 +211,7 @@ public async Task AsyncBlock_ShouldThrowException_WithAwaitInSwitchCaseTestValue
var compiledLambda = lambda.Compile( compiler );

// Act
await Assert.ThrowsExactlyAsync<ArgumentException>( async () => await compiledLambda() );
await compiledLambda();
}

[TestMethod]
Expand Down
4 changes: 2 additions & 2 deletions test/Hyperbee.Expressions.Tests/BlockYieldBasicTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down Expand Up @@ -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 )
Expand Down
3 changes: 2 additions & 1 deletion test/Hyperbee.Expressions.Tests/DebugExpressionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@
}

[TestMethod]
[ExpectedException( typeof( ArgumentException ) )]
public void DebugExpression_Should_Throw_If_Condition_Is_Not_Boolean()

Check warning on line 100 in test/Hyperbee.Expressions.Tests/DebugExpressionTests.cs

View workflow job for this annotation

GitHub Actions / test / test

Prefer 'Assert.ThrowsExactly/ThrowsExactlyAsync' over '[ExpectedException]' (https://learn.microsoft.com/dotnet/core/testing/mstest-analyzers/mstest0006)
{
// Arrange
static void DebugAction( int value )
Expand All @@ -106,7 +107,7 @@
var invalidCondition = Constant( 42 );

// Act
Assert.ThrowsExactly<ArgumentException>( () => _ = Debug( DebugAction, invalidCondition, Constant( 10 ) ) );
_ = Debug( DebugAction, invalidCondition, Constant( 10 ) );

// Assert: Exception is expected
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FastExpressionCompiler" Version="5.3.0" />
<PackageReference Include="FastExpressionCompiler" Version="5.1.1" />
<PackageReference Include="Hyperbee.Json" Version="3.0.6" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.8" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.8" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.8" />
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.8" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.10.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.10.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.10.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.10.2" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion test/Hyperbee.Expressions.Tests/InjectExpressionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
[DataRow( CompilerType.Fast )]
[DataRow( CompilerType.System )]
[DataRow( CompilerType.Interpret )]
[ExpectedException( typeof( InvalidOperationException ), "Service is not available." )]
public void InjectExpression_ShouldInjectSuccessfully_WithBadKey( CompilerType compiler )

Check warning on line 86 in test/Hyperbee.Expressions.Tests/InjectExpressionTests.cs

View workflow job for this annotation

GitHub Actions / test / test

Prefer 'Assert.ThrowsExactly/ThrowsExactlyAsync' over '[ExpectedException]' (https://learn.microsoft.com/dotnet/core/testing/mstest-analyzers/mstest0006)
{
// Arrange
var serviceProvider = GetServiceProvider();
Expand All @@ -95,7 +96,7 @@
var lambda = Lambda<Func<string>>( block );
var compiledLambda = lambda.Compile( compiler );

Assert.ThrowsExactly<InvalidOperationException>( () => compiledLambda() );
compiledLambda();
}

[TestMethod]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ArgumentException>( () => _ = ExpressionExtensions.StringFormat( invalidFormat, Expression.Constant( 10 ) ) );
_ = ExpressionExtensions.StringFormat( invalidFormat, Expression.Constant( 10 ) );

// Assert: Exception is expected
}
Expand Down
3 changes: 2 additions & 1 deletion test/Hyperbee.Expressions.Tests/UsingExpressionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ArgumentException>( () => 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
Expand Down
Loading