Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report nested contexts #130

Open
agross opened this issue Feb 1, 2013 · 7 comments
Open

Report nested contexts #130

agross opened this issue Feb 1, 2013 · 7 comments

Comments

@agross
Copy link
Member

agross commented Feb 1, 2013

Just like rspec, print nested contexts on the console, in ReSharper and the HTML/XML reports.

@theimowski
Copy link

I'd like to look at this one. Should it print the full context in one line for all of these reporters?

@danielmarbach
Copy link
Contributor

@agross what's your take on this? I really have no opinion at all ;)

@agross
Copy link
Member Author

agross commented Jul 18, 2014

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 Establish and Cleanup delegates 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.

@danielmarbach
Copy link
Contributor

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

@ulrichb
Copy link
Contributor

ulrichb commented Oct 15, 2014

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:

R# runner

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).

@shaynevanasperen
Copy link

I would like this as well

@mlidbom
Copy link

mlidbom commented Jan 26, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants