Hi Remco,
Thanks for getting back to me so fast! I analyzed the problems a bit further and noticed that it has to do with if any of the Tests has Multiple Categories.
When the Test Fixture has Multiple Categories no tests will run for that fixture.
If the Test Fixture has One Category all tests without any Category will run.
If any of the Tests has a Category they won't be run if the Test Fixture has a Category.
If any of the Tests has Multiple Categories those Tests won't run.
This is consistent with my new Test Solution you asked me to create. Changing the Framework Utilization Type doesn't make the tests run, but depending on if I have UseStaticAnalysis or UseDynamicAnalysis the appearance is a bit different.
When selecting UseStaticAnalysis:
Tests with nested Categories won't run, won't be visible, and all the dots for the code rows of these tests will be black.
UseDynamicAnalysis:
Tests with nested Cagegories won't run, but will be visible but marked as failed and the first row of the test will have a red > on the top curly bracket. The rest of the dots for the code rows of these tests will be black.
The error of the failed tests will be:
"NCrunch: This test reported an inconclusive result. You can adjust whether NCrunch should treat this result as a pass by using the 'Consider inconclusive tests as passing' NCrunch project-level configuration setting. Category name must not contain ',', '!', '+' or '-'"
Are there a limit to the number of Categories one can have per test?
Regards,
Christer Brannstrom
Here's my Test Code if of interest:
using NUnit.Framework;
namespace NCrunch.Console
{
[TestFixture]
public class NCrunchTest
{
[Test]
// This test will run.
public void Test()
{
new UnitUnderTest().Wtf();
}
[Test, Category("Facebook")]
// This test will run.
public void TestWithCategory()
{
new UnitUnderTest().Wtf();
}
[Test, Category("Facebook"), Category("SAM-16999")]
// This test won't run due to its duplicate Categories.
public void TestWithTwoCategories()
{
new UnitUnderTest().Wtf();
}
}
[TestFixture, Category("Facebook")]
public class NCrunchTestWithCategory
{
[Test]
// This test will run.
public void Test()
{
new UnitUnderTest().Wtf();
}
[Test, Category("SAM-16999")]
// This test won't run due to the Category for the
// TestFixture in combination with its own Category.
public void TestWithCategory()
{
new UnitUnderTest().Wtf();
}
}
[TestFixture, Category("Facebook"), Category("SAM-16999")]
public class NCrunchTestWithTwoCategories
{
[Test]
// This test won't be run due to the duplicate Categories
// for the TestFixture.
public void Test()
{
new UnitUnderTest().Wtf();
}
}
public class UnitUnderTest
{
public string Wtf()
{
return "Hello!";
}
}
}