Recently I've been introduced to Behavior Driven Testing and have run into an issue with the way classes are named.
Example:
[TestClass]
public class MyObjectTests
{
[TestClass]
public class GivenValidAgruments : MyObjectTests
{
[TestClass]
public class WhenConfigurationIsValid : GivenValidAgruments
{
[TestClass]
public class WhenAnotherCaseIsTrue : WhenConfigurationIsValid
{
[TestMethod]
public void ShouldDoSomething()
{
Assert.IsTrue(true);
}
}
}
}
}
This makes for a class name like this:
MyObjectTests.GivenValidArguments.WhenConfigurationIsValid.WhenAnotherCaseIsTrue
I can see the benefit of this kind of a structure. Unfortunately, I've run into an issue where the class name is getting too long. Either Visual Studio is getting confused, or I've reached some kind of limitation in the unit test framework when it uses reflection to get all the classes. Regardless of the actual cause, the problem is that the names are too long.
Have you run into this before? What did you do to resolve the issue? Do you have recommendations for following this pattern, but making it cleaner?