Skip to content

Commit

Permalink
"MSTest.TestAdapter" Version="3.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed May 11, 2024
1 parent cafc3e3 commit 17fef59
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/ApprovalTests.MSTest/ApprovalTests.MSTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ItemGroup>
<Using Remove="System.Net.Http" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.3.1" />
<PackageReference Include="MSTest.TestFramework" Version="3.3.1" />
<ProjectReference Include="..\ApprovalUtilities\ApprovalUtilities.csproj" />
<ProjectReference Include="..\ApprovalTests\ApprovalTests.csproj" />
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
Expand Down
4 changes: 2 additions & 2 deletions src/ApprovalTests.MSTest/MSTestReporterTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ public void TestReporter()
Approvals.Verify("Hello");
Assert.Fail("Above verification should have thrown an AssertFailedException");
}
catch (Exception e)
catch (Exception exception)
{
Assert.AreEqual("Assert.AreEqual failed. Expected:<World>. Actual:<Hello>. ", e.Message);
Assert.AreEqual("Assert.AreEqual failed. Expected:<World>. Actual:<Hello>. ", exception.Message);
}
}
}
11 changes: 8 additions & 3 deletions src/ApprovalTests/Reporters/TestFrameworks/MsTestReporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@ protected override void InvokeEqualsMethod(Type type, string[] parameters)
var bindingFlags = BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Static;
var areEquals = type
.GetMethods(bindingFlags)
.Single(_ => _.Name == "AreEqual" &&
_.ContainsGenericParameters &&
_.GetParameters().Length == 2);
.Single(_ =>
{
var infos = _.GetParameters();
return _.Name == "AreEqual" &&
_.ContainsGenericParameters &&
infos.Length == 2 &&
infos.All(_ => !_.ParameterType.IsInterface);
});
var method = areEquals.MakeGenericMethod(typeof(string));
method.Invoke(null, parameters);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<LangVersion>preview</LangVersion>
<NoWarn>CS1591;CA1416;SYSLIB0014</NoWarn>
<Version>7.0.0-beta.2</Version>
<Version>7.0.0-beta.3</Version>
<AssemblyVersion>3.0</AssemblyVersion>
<AssemblyOriginatorKeyFile>$(ProjectDir)..\ApprovalsKeyPair.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
Expand Down

0 comments on commit 17fef59

Please sign in to comment.