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
4 changes: 2 additions & 2 deletions packages/csharp/src/AlphaTab.Test/AlphaTab.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="3.0.5" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.11.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.11.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.11.1" />
<PackageReference Include="MSTest.TestAdapter" Version="4.5.2" />
<PackageReference Include="MSTest.TestFramework" Version="4.5.2" />
<PackageReference Include="AlphaSkia" Version="3.5.147" />
<PackageReference Include="AlphaSkia.Native.Windows" Version="3.4.135" Condition="$([MSBuild]::IsOsPlatform('Windows'))" />
<PackageReference Include="AlphaSkia.Native.Linux" Version="3.5.147" Condition="$([MSBuild]::IsOsPlatform('Linux'))" />
Expand Down
2 changes: 1 addition & 1 deletion packages/csharp/src/AlphaTab.Test/Test/Globals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static Expector<Action> Expect(Action actual)

public static void Fail(object? message)
{
Assert.Fail(Convert.ToString(message));
Assert.Fail(Convert.ToString(message) ?? string.Empty);
}

private static readonly Dictionary<string, int> SnapshotAssertionCounters = new();
Expand Down
13 changes: 10 additions & 3 deletions packages/csharp/src/AlphaTab.Test/TestClassAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting;

// ReSharper disable once CheckNamespace
Expand All @@ -18,14 +20,19 @@ public TestClassAttribute(string displayName)

public class TestMethodAttribute : Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute
{
public TestMethodAttribute(string displayName) : base(displayName)
public TestMethodAttribute(
string displayName,
[CallerFilePath] string callerFilePath = "",
[CallerLineNumber] int callerLineNumber = -1
) : base(callerFilePath, callerLineNumber)
{
DisplayName = displayName;
}

public override TestResult[] Execute(ITestMethod testMethod)
public override async Task<TestResult[]> ExecuteAsync(ITestMethod testMethod)
{
TestMethodAccessor.CurrentTest = testMethod;
var result = base.Execute(testMethod);
var result = await base.ExecuteAsync(testMethod);
TestMethodAccessor.CurrentTest = null;
return result;
}
Expand Down
Loading