How do I use MSTest without Visual Studio?

MSTest can be used without installing Visual Studio. You will need to install Visual Studio Test Agent, which is a free download from Microsoft. I think this approach is better from a licensing perspective than manually copying MSTest.exe and its dependencies onto the build server. See this blog for reference: http://blogs.msdn.com/b/anutthara/archive/2009/12/16/running-tests-in-mstest-without-installing-the-vs-ide.aspx

Ignore IgnoreAttribute

Recently when I have encountered problems such as this, I add a new Build Configuration to the visual studio project named something such as “Local Developer Debug” and use the settings from the existing Debug configuration. Then I go to “Project -> MyProjectName Properties -> Build”, make sure “Local Developer Debug” is the selected configuration … Read more

xUnit Equivalent of MSTest’s Assert.Inconclusive

Best thing one can do until something is implemented in the library is to use Xunit.SkippableFact: [SkippableFact] public void SomeTest() { var canRunTest = CheckSomething(); Skip.IfNot(canRunTest); // Normal test code } This will at least make it show up as a yellow ignored test case in the list. Credit goes to https://stackoverflow.com/a/35871507/537842

DataTestMethod and DataRow attributes in MSTEST

There is a good walkthrough originally published at https://blogs.msmvps.com/bsonnino/2017/03/18/parametrized-tests-with-ms-test (link is now to archive by wayback machine). In a nutshell, you will need to install MSTest.TestFramework and MSTest.TestAdapter, and remove references to Microsoft.VisualStudio.QualityTools.UnitTestFramework. You can then indicate a parameterised test with the [DataTestMethod] attribute, and can add your parameters using the [DataRow] attribute, as per … Read more