Unit Testing Client Installation (using NUnit and MSTest)

I have developed a large unit test base for my enterprise application, and the developer would like to transfer my unit tests to our support department to help them debug client installation problems. I wrote my unit tests using mstest, so support would have to install Visual Studio on the client machine if they wanted to use my tests out of the box, which is clearly not the case. I studied using mstest without VS on the command line, but hacking the registry on the client system to make it think that VS is installed also does not work.

To get around this, I planned to collect my mstests for nunit using the information in this post . However, after compiling with NUnit enabled and adding the test assembly DLL to the NUnit runner, I get the error message "This assembly was not built with any known infrastructure."

Has anyone done this and have tips / tricks for this? Or is this a completely wrong way to solve this problem? Thanks.

+3
source share
2 answers

I'm going to go with my second thought about it, “Or is this a completely wrong way to solve this problem.”

, . , , :

using CSharpTest.Net.Commands;
static void Main(string[] args)
{
    MyTest testClass = new MyTest();
    // optional: testClass.MySetupMethod();
    new CommandInterpreter(testClass).Run(args);
}

exe , CSharpTest.Net.Libary.dll. CSharpTest.Net.Commands CSharpTest.Net.Libary.dll .

( MyTest ) , . Environment.ExitCode. , :

public class MyTest
{
    [System.ComponentModel.DisplayName("rename-this-function")]
    [System.ComponentModel.Description("Some description for tech-support")]
    [System.ComponentModel.Browsable(true | false)]
    public void TestSomeFunction()
    { ... }
}

( , , -:)

+1

, - unit test ( , unit test), . , , , , , , .

? , , .

+1

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


All Articles