Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Assert.AreEqual breaks with MSTest v3 #3

@igitur

Description

@igitur

Hi,

When upgrading my test project to MSTest 3.0.2 I noticed some tests failing. I think there was a breaking change in microsoft/testfx#1433 . From what I can gather, mstest-extensions is still source compatible, but I suspect there's been a break in binary compatibility. If so, this should require a rebuild and rerelease of the NuGet package, right?

Here is a sample case:

<!-- .csproj file -->
<Project Sdk="Microsoft.NET.Sdk">

	<PropertyGroup>
		<TargetFramework>net462</TargetFramework>
	</PropertyGroup>

	<ItemGroup>
		<PackageReference Include="Microsoft.UnitTestFramework.Extensions" Version="2.0.0" />
		<PackageReference Include="MSTest.TestFramework" Version="3.0.1" />
		<PackageReference Include="MSTest.TestAdapter" Version="3.0.1" />
	</ItemGroup>

</Project>
[TestMethod]
public void TestObjectEquality()
{
    var target = new UnitTest();

    var assert = target.Assert;

    assert.AreEqual((object)5, (object)5);
}

The test output is:

 TestObjectEquality
   Source: UnitTest1.cs line 7
   Duration: 141 ms

  Message: 
Test method UnitTestTest.TestObjectEquality threw exception: 
System.MissingMethodException: Method not found: 'Void Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(System.Object, System.Object)'.

  Stack Trace: 
UnitTestTest.TestObjectEquality() line 14

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions