Skip to content
Open
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
32 changes: 8 additions & 24 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
version: 2
updates:
- package-ecosystem: nuget
directory: "/"
schedule:
interval: daily
time: "11:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: Microsoft.NET.Test.Sdk
versions:
- 17.4.0s
- dependency-name: MSTest.TestAdapter
versions:
- 2.2.10
- dependency-name: MSTest.TestFramework
versions:
- 2.2.10
- dependency-name: FluentAssertions
versions:
- 6.8.0
- dependency-name: coverlet.collector
versions:
- 3.2.0
version: 2
updates:
- package-ecosystem: nuget
directory: "/"
schedule:
interval: daily
time: "11:00"
open-pull-requests-limit: 10
10 changes: 0 additions & 10 deletions .github/workflows/pr_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ jobs:
with:
global-json-file: "./global.json"

- name: "Install .NET 6 SDK"
uses: actions/setup-dotnet@v4.3.1
with:
dotnet-version: '6.x'

- name: "Restore .NET tools"
run: dotnet tool restore

Expand Down Expand Up @@ -70,11 +65,6 @@ jobs:
with:
global-json-file: "./global.json"

- name: "Install .NET 6 SDK"
uses: actions/setup-dotnet@v4.3.1
with:
dotnet-version: '6.x'

- name: "Restore .NET tools"
run: dotnet tool restore

Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<PropertyGroup>
<LibraryFramework>netstandard2.0;net8.0</LibraryFramework>
<TestFramework>net6.0;net8.0</TestFramework>
<TestFramework>net8.0</TestFramework>
</PropertyGroup>

<!-- SourceLink support for all Akka.NET projects -->
Expand Down
19 changes: 0 additions & 19 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,13 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<!-- Nuget package versions -->
<AkkaVersion>1.5.67</AkkaVersion>
<MSTestVersion>3.10.0</MSTestVersion>
<MSTest4Version>4.1.0</MSTest4Version>
<TestSdkVersion>17.5.0</TestSdkVersion>
</PropertyGroup>
<!-- App dependencies -->
<ItemGroup>
<PackageVersion Include="Akka.TestKit" Version="$(AkkaVersion)" />
</ItemGroup>
<!-- MSTest: 3.x for < net8.0, 4.x for net8.0+ -->
<ItemGroup Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<PackageVersion Include="MSTest.TestFramework" Version="$(MSTestVersion)" />
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<PackageVersion Include="MSTest.TestFramework" Version="$(MSTest4Version)" />
</ItemGroup>
<!-- Test dependencies -->
<ItemGroup>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
<PackageVersion Include="coverlet.collector" Version="3.2.0" />
</ItemGroup>
<ItemGroup Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<PackageVersion Include="MSTest.TestAdapter" Version="$(MSTestVersion)" />
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<PackageVersion Include="MSTest.TestAdapter" Version="$(MSTest4Version)" />
</ItemGroup>
<!-- SourceLink support for all Akka.NET projects -->
<ItemGroup>
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0"/>
Expand Down
3 changes: 3 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"msbuild-sdks": {
"MSTest.Sdk": "4.1.0"
},
"sdk": {
"version": "8.0.418",
"rollForward": "major"
Expand Down
11 changes: 2 additions & 9 deletions src/Akka.TestKit.MsTest.Tests/Akka.TestKit.MsTest.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="MSTest.Sdk">

<PropertyGroup>
<TargetFrameworks>$(TestFramework)</TargetFrameworks>
<TargetFramework>$(TestFramework)</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
Expand All @@ -11,11 +11,4 @@
<ProjectReference Include="..\Akka.TestKit.MsTest\Akka.TestKit.MsTest.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="MSTest.TestFramework" />
<PackageReference Include="MSTest.TestAdapter" />
<PackageReference Include="coverlet.collector" />
</ItemGroup>

</Project>
2 changes: 0 additions & 2 deletions src/Akka.TestKit.MsTest.Tests/AssertionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
// </copyright>
//-----------------------------------------------------------------------

using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Akka.TestKit.MsTest.Tests
{
[TestClass]
Expand Down
1 change: 0 additions & 1 deletion src/Akka.TestKit.MsTest.Tests/TestKitTestFixtureTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

using Akka.Actor;
using Akka.TestKit.TestActors;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Akka.TestKit.MsTest.Tests
{
Expand Down
1 change: 0 additions & 1 deletion src/Akka.TestKit.MsTest.Tests/TestKitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
//-----------------------------------------------------------------------

using Akka.Actor;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Akka.TestKit.MsTest.Tests
{
Expand Down
1 change: 0 additions & 1 deletion src/Akka.TestKit.MsTest.Tests/Usings.cs

This file was deleted.

60 changes: 4 additions & 56 deletions src/Akka.TestKit.MsTest/MsTestAssertions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,65 +46,13 @@ private static string FormatValue<T>(T expected)
return ReferenceEquals(expected, null) ? "null" : expected.ToString();
}

public Exception AssertThrows(Action action)
{
try
{
action();
}
catch (Exception ex)
{
return ex;
}
throw new AssertFailedException("Expected an exception to be thrown, but no exception was thrown.");
}
public Exception AssertThrows(Action action) => Assert.Throws<Exception>(action);

public TException AssertThrows<TException>(Action action) where TException : Exception
{
try
{
action();
}
catch (TException ex)
{
return ex;
}
catch (Exception ex)
{
throw new AssertFailedException($"Expected exception of type {typeof(TException)} but got {ex.GetType()}: {ex.Message}");
}
throw new AssertFailedException($"Expected exception of type {typeof(TException)}, but no exception was thrown.");
}
public TException AssertThrows<TException>(Action action) where TException : Exception => Assert.ThrowsExactly<TException>(action);

public async Task<Exception> AssertThrowsAsync(Func<Task> action)
{
try
{
await action();
}
catch (Exception ex)
{
return ex;
}
throw new AssertFailedException("Expected an exception to be thrown, but no exception was thrown.");
}
public async Task<Exception> AssertThrowsAsync(Func<Task> action) => await Assert.ThrowsAsync<Exception>(action);

public async Task<TException> AssertThrowsAsync<TException>(Func<Task> action) where TException : Exception
{
try
{
await action();
}
catch (TException ex)
{
return ex;
}
catch (Exception ex)
{
throw new AssertFailedException($"Expected exception of type {typeof(TException)} but got {ex.GetType()}: {ex.Message}");
}
throw new AssertFailedException($"Expected exception of type {typeof(TException)}, but no exception was thrown.");
}
public async Task<TException> AssertThrowsAsync<TException>(Func<Task> action) where TException : Exception => await Assert.ThrowsExactlyAsync<TException>(action);
}
}