2

I have a simple C# UnitTest project with a single test that targets .net 4.5.2

The test looks like this:

[TestMethod]
public void TestMethod()
{
  Assert.AreEqual("A © B © C © D ☺ E 𑄑 F", HttpUtility.HtmlDecode("A © B © C © D ☺ E 𑄑 F"));
}

When I run the test in VS2015 everything passes as expected.

The problem is when I run the test using MSTest. The test fails with the output

Assert.AreEqual failed. Expected:<A © B © C © D ☺ E 𑄑 F>. Actual:<A © B © C © D ☺ E &#x11111; F>.

Based on the Actual output it appears to be using .net 4 which is not the target framework of my project.

I'm running mstest.exe from

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\MSTest.exe

Am i doing something wrong here or is there a different version of MSTest I should be using?

EDIT: Looking at the MSTest output I think my logic is backwards here. MSTest is correctly failing where Visual Studio is not.

0

1 Answer 1

1

MSTest.exe is deprecated and should only be used for backwards compatibility for projects from VS2010.

You can run the tests using VSTest.Console.exe and you will see the same result that you are seeing in Visual Studio.

VSTest.console.exe can be found at: %VS140COMNTOOLS%\..\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.