Skip to content
This repository has been archived by the owner on Dec 12, 2017. It is now read-only.

Test runner doesn't show structure with nested test classes #37

Open
havremunken opened this issue Mar 13, 2015 · 3 comments
Open

Test runner doesn't show structure with nested test classes #37

havremunken opened this issue Mar 13, 2015 · 3 comments

Comments

@havremunken
Copy link

Hi,

I'm trying to use a unit testing setup structure close to what Phil Haack described here:

http://haacked.com/archive/2012/01/02/structuring-unit-tests.aspx/

However, when I use nested classes for structuring tests, the ReSharper 9 test runner does not show the complete test structure. I do not know if this is an issue with the ReSharper test runner itself, or the xUnit specific extension.

Here is an exaggerated example to show my point:

image

When I run the unit tests with the option set to group by project structure, it looks like this:

image

If I try to group by Projects and Namespaces, it looks like this:

image

So it seems like we only see the actual class that contains a test - any parent classes that itself does not hold one or more unit tests are not visible as part of the hierarchy.

Is this by design, or should I actually be able to see the exaggerated structure in this case?

Edit: I should mention - one of the problems with this is that it gets hard to tell tests for different classes apart when doing this. In the example above, if I had another class with tests in a GivenNullInput subclass, they would be kept apart, but visible at the same level with no indication of what they belong to.

@citizenmatt
Copy link
Contributor

Interestingly, this is how the nunit runner shows it. How would you expect it to look?

@havremunken
Copy link
Author

That probably means that this request shouldn't be for the xUnit extension specifically.

In the last of my screenshots you can see the following structure:

TestStructureProject
-TestStructureProject
--GivenNullInput
---Does_Nothing

In order to get what I want (and keep in mind, this is unrealistic, just to underline the point), the structure would be something like

TestStructureProject
-TestStructureProject
--TestClassTests
---Methods
----SomeMethod
-----GivenNullInput
------Does_Nothing

I doubt it would be that deep in practice, but I think it would be helpful to be able to display the full hierarchy of the test project, not just the root level, and then the classes that contain actual tests. In order to benefit from the Phil Haack method (link in first post), more of the structure would need to be visible.

@ErikSchierboom
Copy link

I agree that this would be very helpful.

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

No branches or pull requests

3 participants