4

Suppose I have a unit test project UnitTests.dll:

using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UnitTests
{
    [TestClass]
    public class MyTests
    {
        [TestMethod]
        public void TestMethod1()
        {
            Assert.IsTrue(true);
        }

        [TestMethod]
        public void TestMethod2()
        {
            Assert.IsTrue(false);
        } 
    }
}

I would like to run the above unit tests programmatically from another project RunUniTests.exe. How do I do that? Something that's similar to NUnit counterpart such as the one shown in How to run NUnit programmatically would be great.

1 Answer 1

4

You can use command line to run it programmatically

"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\MSTest.exe" /testmetadata:"vsmdiFile" /testsettings:

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.