I have unit tests written using nUnit and tests are structured in a similar way as in Phil Haack's post
namespace MyNamespace
{
[TestFixture]
public class ClassToTest
{
[TestFixture]
public class MethodToTest
{
[Test]
public void ThrowsArgumentNullException_OnNullIndex()
{
...
}
.. more tests for the method ..
}
[TestFixture]
public class AnotherMethodToTest
{
[Test]
public void ThrowsArgumentNullException_OnNullIndex()
{
...
}
.. more tests for the method ..
}
}
}
My problem is that I get inconclusive for the outer class that is used to group unit tests. I have tried with and without [TestFixture]
on the outer and/or inner class, but it is always giving me Inconclusive.
I think the correct behavior should be to display unit test states from the inner class tests. Any ideas?
Update
One ugly fix seems to be creating a dummy test to the outer class and then put attribute Ignore
on it.
[Test, Ignore]
public void DummyTest()
{
Assert.IsTrue(true);
}
Update 2
Channs & Wayne are correct, outer class is just used for grouping, so changing from class to namespace is the best solution.
Your outer class only groups the related methods, suggest replacing it by a namespace.
namespace MyNamespace.ClassToTest
{
...
}
You probably have a [TestFixture] with no [Test]s -- maybe the outer class doesn't have any of its own tests? In which case, why not just use a namespace?
just a guess, the attribute on the class causes your class to be handled as a testclass, but there are no test in the class it self causes our Inconclusive:
[TestFixture]
public class ClassToTest
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With