question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Test explorer tree view groups [Theory] attributed tests differently

See original GitHub issue

I have a sample unit testing project with one test class including following unit test methods; two [Fact] attributed, another two [Fact] attributed but also Skip enabled, and finally, two [Theory] attributed with both having two [InlineData].

As you can see below, the [Theory] attributed test methods are grouped differently when you run tests.

On the other hand, this is not the case when you discover tests using refresh button. I reckon, all test methods of the same test class should be grouped together regardless of [Fact] and [Theory] attributes.

P.S. This bug report also has a relation with this one #200, but addresses a different aspect the current UX. For that reason, I thought it is better to report separately.

My system information: Version: 1.33.0 (system setup) Electron: 3.1.6 Chrome: 66.0.3359.181 Node.js: 10.2.0 V8: 6.6.346.32 OS: Windows_NT x64 10.0.17134 .NET Core Test Explorer: 0.6.6 .NET Core: 2.2 xUnit.net: 2.4

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12

github_iconTop GitHub Comments

2reactions
stefanforsbergcommented, Apr 20, 2019

I’ve added a known issue for this and will close this in the mean time. Thanks a lot for your help in fleshing this out @kahveci and @MatthewS2077

2reactions
kahvecicommented, Apr 11, 2019

@stefanforsberg after your message, I tried a couple of different scenarios and managed to find the root cause I guess. Simply, your test class namespace must match with the assembly name. My assembly name is Playgroundx.LogAn.Tests while the namespace is Playgroundx.LogAn. I changed the test class namespace as Playgroundx.LogAn.Tests, and the problem solved as follows. Hope this helps fixing the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Part 2–Using Traits with different test frameworks in the Unit ...
Notice that the special new attributes made above for 'CI' and 'Priority' are treated the same as the original ones. Class based attributes....
Read more >
Why does my Theory unit test say "test has multiple result ...
However, I have one test which is behaving differently - it shows as a single test in the tree view of projects, namespaces,...
Read more >
No longer able to group by trait in Test Explorer with VS 2019 ...
We are trying to see how we can design group by traits in the hierarchy view, which, as you can imagine, will be...
Read more >
Getting Started: .NET Framework with Visual Studio > xUnit.net
Create a unit test project; Learning to use Test Explorer; Write your first tests; Write your first theory; Running tests against multiple target...
Read more >
Working with Unit Tests in Project or Solution - JetBrains
This rarely happens in practice, but if you do have tests with the same ID, they will appear as a single node in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found