0
votes

In Visual Studio 2015 V14 Update3 with NUnit Adapter 3.10.0.21 and NUnit Framework 3.10.1, the Visual Studio Test Explorer shows tests with sources, but some tests cannot be run via T.Explorer.

Visual Studio - Test Explorer

After running all tests, not all tests were run:

To select one of the last two tests and running it just yields no result, and a fairly useless messages in the Tests Output window:

------ Run test started ------
NUnit Adapter 3.10.0.21: Test execution started
Running selected tests in C:\TFS\TestFactory\TA\DA\DAGICom\bin\Debug\DAGICom.exe
NUnit3TestExecutor converted 5 of 5 NUnit test cases
NUnit Adapter 3.10.0.21: Test execution complete
========== Run test finished: 0 run (0:00:02,49) ==========
1
Not enough info to go on here. Can you provide some code? You might also check whether the output for one of the three tests that executed actually has multiple results in the IDE due to test naming collisions. - Charlie

1 Answers

1
votes

I solved, the problem depends on the length of a string passed to the test method. With the previous combination Nunit.Framework ("3.2.0") and NUnit3TestAdapter (3.0.10) there was not this problem. Currently,It seems as if the maximum string fixed-length is 850 characters.

max fixed-length(result) = 850 characters.

[Test(Author = "Michele Delle Donne"), Description("")]
    [TestCaseSource("TC_XXXX_XXXXXXXXXX"), Category("XXXXX")]      
    public void DA_ACOM(Type testClass, string environment, string user, string pwd, string result)
    {           
        Services.ObjBase automationTest = null;

        object[] args = new object[] { Settings_Default.browser, environment, testClass.ToString(), testClass.ToString(), result };

        automationTest = (Services.ObjBase)Activator.CreateInstance(testClass, args);

        if (automationTest != null)
        {
            automationTest.ExecuteAutomation(environment, user, pwd);
        }

        Thread.Sleep(TimeSpan.FromSeconds(1));
        automationTest.End();       
    }