I have inner classes to unit-test instance methods like below.
My problem is when I go to FooClassTests
and use VS to run all tests in context, it skips the inner class tests.
If you are using this structure, do you know how can I run all tests together with the ones in the inner classes?
[TestClass]
public class FooClassTests
{
[TestMethod]
public void CanGuardConstructorParameters()
{
// Asserts here
}
[TestClass]
public class DoWorkTests //Tests method DoWork
{
[TestMethod]
public void CanDoTheWork()
{
// Asserts here
}
}
}
Via Visual Studio Runner I don't know but this is supported in NCrunch. This is how I structure all my tests.
See http://www.ncrunch.net/
This guy seems to be using it fine in MS Test too:
http://zendeveloper.blogspot.ie/2012/01/structuring-unit-tests.html
And I am almost certain that these type of tests work in resharper's test runner.
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