Mute remaining MSTest usage warnings

This commit is contained in:
YoshiRulz 2025-04-16 23:12:28 +10:00
parent 1fb2daaac0
commit 3017459a3a
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
3 changed files with 6 additions and 1 deletions

View File

@ -283,7 +283,6 @@ namespace BizHawk.Tests.Client.Common.Movie
var actual = zw.GetStateClosestToFrame(futureReservedFrame + 1); var actual = zw.GetStateClosestToFrame(futureReservedFrame + 1);
// Assert // Assert
Assert.IsNotNull(actual);
Assert.AreEqual(futureReservedFrame, actual.Key); Assert.AreEqual(futureReservedFrame, actual.Key);
} }

View File

@ -1,3 +1,5 @@
#pragma warning disable MSTEST0037 // wants `Assert.IsTrue` calls to be more specific
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
@ -88,7 +90,9 @@ namespace BizHawk.Tests.Client.Common.Lua
[LuaMethod("pass_color", "")] [LuaMethod("pass_color", "")]
public static void PassColor(object? o) public static void PassColor(object? o)
#pragma warning disable MSTEST0026 // "Prefer adding an additional assertion that checks for null" ??? maybe structure like the below method?
=> Assert.IsTrue(_th.SafeParseColor(o)?.ToArgb() == ((Color?)ExpectedValue)?.ToArgb()); => Assert.IsTrue(_th.SafeParseColor(o)?.ToArgb() == ((Color?)ExpectedValue)?.ToArgb());
#pragma warning restore MSTEST0026
[LuaMethod("pass_table", "")] [LuaMethod("pass_table", "")]
public static void PassTable(NLua.LuaTable? o) public static void PassTable(NLua.LuaTable? o)

View File

@ -65,7 +65,9 @@ namespace BizHawk.Tests
this CollectionAssert assert, this CollectionAssert assert,
IReadOnlyCollection<T> collection, IReadOnlyCollection<T> collection,
string? message = null) string? message = null)
#pragma warning disable MSTEST0037 // intentionally not using `Assert.AreEqual` here as the "ex: 0, ac: 4" message might be confusing
=> Assert.IsTrue(collection.Count is 0, message); => Assert.IsTrue(collection.Count is 0, message);
#pragma warning restore MSTEST0037
/// <remarks>dumb param order matches predefined method</remarks> /// <remarks>dumb param order matches predefined method</remarks>
public static void IsSubsetOf<T>( public static void IsSubsetOf<T>(