nunit3-vs-adapter
nunit3-vs-adapter copied to clipboard
[Enhancement] Report non-runnable tests during test discovery
Currently to discover that test case source throws exception for some reason, user needs to run test. It would be nice, if adapter could report error message to Tests output window during tests discovery in such situations.
Why it could improve usability: In our case we accidentally broke test case source in branch under development and noticed that number of tests decreased significantly. it took some time to find out a reason, because there were a lot of tests broken due to other reasons (new tests for feature or tests broken by new feature). We even thought that it's due some bug in adapter, because it's still in CTP.
I agree entirely about the usefulness of this feature. It's what we do in our gui for example. However, to my knowledge, there is no way to tell VS to do this during discovery. It's only upon receiving a result from running the test that it changes the icon for the test.
That said, I'll investigate further before closing this. Ideas are welcome too!
Isn't it possible to use TestLogger.SendErrorMessage? I see that class is available and used in NUnit3TestDiscoverer class. If this situation could be detected there, message in test log will be more that enought.
Yes, that's possible. Not as cool as changing the icon, but would have saved you time.
I'll experiment with this.
Another possibility: report the method itself as a non-runnable test case, without parameters. That would show up in the tree and we could tailor the message to explain what happened.