From 546c62a6201781bc3cf8ba8bb06450f6fab393ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Oct 2026 09:56:03 +0000 Subject: [PATCH 1/2] Bump MSTest.TestAdapter and MSTest.TestFramework Bumps MSTest.TestAdapter from 3.11.1 to 4.5.2 Bumps MSTest.TestFramework from 3.11.1 to 4.5.2 --- updated-dependencies: - dependency-name: MSTest.TestAdapter dependency-version: 4.5.2 dependency-type: direct:production update-type: version-update:semver-major - dependency-name: MSTest.TestFramework dependency-version: 4.5.2 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- packages/csharp/src/AlphaTab.Test/AlphaTab.Test.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/csharp/src/AlphaTab.Test/AlphaTab.Test.csproj b/packages/csharp/src/AlphaTab.Test/AlphaTab.Test.csproj index dfe12aebe..4c44d396c 100644 --- a/packages/csharp/src/AlphaTab.Test/AlphaTab.Test.csproj +++ b/packages/csharp/src/AlphaTab.Test/AlphaTab.Test.csproj @@ -12,8 +12,8 @@ - - + + From 4b42c99b891a27266f7bc6e36f233cfbf38d2015 Mon Sep 17 00:00:00 2001 From: Danielku15 Date: Fri, 30 Oct 2026 18:41:01 +0100 Subject: [PATCH 2/2] test(csharp): adapt test attributes to MSTest 4 MSTest 4 replaced TestMethodAttribute.Execute with ExecuteAsync and its constructor now takes caller file/line info; the display name moved to the DisplayName property. Assert.Fail no longer accepts a null message. --- packages/csharp/src/AlphaTab.Test/Test/Globals.cs | 2 +- .../csharp/src/AlphaTab.Test/TestClassAttribute.cs | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/csharp/src/AlphaTab.Test/Test/Globals.cs b/packages/csharp/src/AlphaTab.Test/Test/Globals.cs index 06968ea81..111267de4 100644 --- a/packages/csharp/src/AlphaTab.Test/Test/Globals.cs +++ b/packages/csharp/src/AlphaTab.Test/Test/Globals.cs @@ -36,7 +36,7 @@ public static Expector 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 SnapshotAssertionCounters = new(); diff --git a/packages/csharp/src/AlphaTab.Test/TestClassAttribute.cs b/packages/csharp/src/AlphaTab.Test/TestClassAttribute.cs index 277cd77b3..a7b397eab 100644 --- a/packages/csharp/src/AlphaTab.Test/TestClassAttribute.cs +++ b/packages/csharp/src/AlphaTab.Test/TestClassAttribute.cs @@ -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 @@ -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 ExecuteAsync(ITestMethod testMethod) { TestMethodAccessor.CurrentTest = testMethod; - var result = base.Execute(testMethod); + var result = await base.ExecuteAsync(testMethod); TestMethodAccessor.CurrentTest = null; return result; }