Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NUnit3TestExecutor converted 279 of 279 NUnit test cases

Tags:

nunit-3.0

I get NUnit3TestExecutor converted 279 of 279 NUnit test cases in the output when I compile. Why?
I suppose the solution has been upgraded once from 2 to 3 but that is about all of a clue I have.

I have checked we only use Nunit version 3.
279 is just a few of all the tests we have.

UPDATE

Digging into NUnit3TestExecutor I find

private void RunAssembly(string assemblyName, TestFilter filter) {
    ...
    var nunitTestCases = loadResult.SelectNodes("//test-case");
    ...
    foreach (XmlNode testNode in nunitTestCases){
        loadedTestCases.Add(testConverter.ConvertTestCase(testNode));
    }
    TestLog.Info(string.Format("NUnit3TestExecutor converted {0} of {1} NUnit test cases", loadedTestCases.Count, nunitTestCases.Count));
    ...
}

ConvertTestCase looks like this

    /// <summary>
    /// Converts an NUnit test into a TestCase for Visual Studio,
    /// using the best method available according to the exact
    /// type passed and caching results for efficiency.
    /// </summary>
    public TestCase ConvertTestCase(XmlNode testNode)

which is the culprit.

Which seems correct since we have Nunit tests running inside Visualstudio. But... we don't have 279 [TestFixture] or [Test]. There is something more at play.
So I am still in limbo.

like image 606
LosManos Avatar asked May 29 '17 14:05

LosManos


1 Answers

That "NUnit3TestExecutor converted x of x NUnit test cases" log comes from this code, which is calling the ConvertTestCase method here.

The documentation on that method says

Converts an NUnit test into a TestCase for Visual Studio,
using the best method available according to the exact
type passed and caching results for efficiency.

So it seems that it's not about what version of NUnit you have, but just converting the tests into a format that Visual Studio understands.

like image 53
Hod - Monica's Army Avatar answered Oct 22 '22 23:10

Hod - Monica's Army