VS 2008 / MSTest - how do I execute a subset of all tests?

I just started using MSTest in a Visual Studio project (NUnit was what I used before), and I have a few questions.

I see that if I right-click on one test method and select a launch test, it will check this method. Good. But is there a way to set up a test run that only runs my tests of my choice, and not all of them? I looked at the test menu and the options in it, but I cannot figure out how to do this.

Also, how can I debug a subset of my tests? Right now, if I debug the MSTest project, they all start. Sorry for the questions related to the newbie, I was kicking the menu options, but nothing came to me on these issues. Thanks!

+3
source share
4 answers

Visual Studio allows you to create test lists that do exactly what you want. See here: http://msdn.microsoft.com/en-us/library/ms182462.aspx

Also this link may be useful: http://freekleemhuis.com/2008/04/20/unit-testing-in-visual-studio-2008-part-1/

+3
source

Kona is suitable for the list you want to keep; I find a lot of time when I don't need a list that withstands the test of time, only one that I can run in the next few minutes / hours.

In this scenario, I use the "Test" window, select what I have to start ( CTRL + Left Clickfor multiples) and click the start button.

Kindness,

Dan

+2

, , : Run Tests in Current Context. , , , , . ctrl r + t .

, , (, , ), , . , - . , , . , , , , , , .

, , . , . .

namespace Tests
{
    // Cursor here to run all tests in Tests
    [TestClass()]
    public class ClassOfTests
    {
        // Cursor here to run all Tests in this class
        [TestMethod()]
        public void MethodUnderTest_WithThisSetup_ReturnsValue()
        {
            // Cursor here to only run this test
        }

    }

}
0

. [TestCategory("name of my category goes here")] , . . Test Explorer VS2017 / .

. .

0

Source: https://habr.com/ru/post/1723529/


All Articles