Report nested contexts
Just like rspec, print nested contexts on the console, in ReSharper and the HTML/XML reports.
I'd like to look at this one. Should it print the full context in one line for all of these reporters?
@agross what's your take on this? I really have no opinion at all ;)
What's required for this to work is quite a lot IMHO:
- a revamped reporting model with parent/child relationships
- updated HTML and XML reports as well as the obvious ones (console/TD.net)
- a defined process which
EstablishandCleanupdelegates are run in which order - probably rewritten runners, i.e. ReSharper would need to create
UnitTestElements for all the parents
That said, I think it's a major effort that's not done over the weekend.
So currently not worth the risk and effort. Especially not now because I want to have a stable interface between the core and the resharper runner
class When_given_X
{
class and_Y
{
Because of = () => { };
It should_happen_something = () => { };
}
class and_Z
{
Because of = () => { };
It should_happen_something_else = () => { };
}
}
... at the moment, this results in the following visualization:
Instead of the full-blown solution, which seems to be hard to implement, what about a simpler solution in the meantime: just concatenate the context strings (and stay with the flat model)?
<MSpecSample> (2 tests)
When X and Y
should happen something
When X and Z (1 test)
should happen something else
This would be a big help for people, which use nested contexts (which is one of the big advanages over all xUnit frameworks).
I would like this as well
I definitely think this is how it should work.
I got all excited when experimenting with mspec and finding how it handled nested contexts. Then I saw the output and my smile turned upside down. When only the inner-most of the nested contexts is reported the test report becomes completely incomprehensible instead of the human readable specification that it could/should be.