What is the right way to use Assert.Inconclusive and IgnoreAttribute in MS Unit test framework?
We are using Assert.Inconclusive mainly for tests which are:
- Not implemented yet
- Somehow broken or incomplete = requires futher attention
- When test body is for any reason commented out
We are doing this because:
- Inconclusive test can have message
- We want to see such tests in test results on TFS
Our problem is that Inconclusive tests are marked as error in both TFS and Resharper. If we use IgnoreAttribute instead we will see these tests in Resharper but MS Test runner and TFS will ignore them at all. Using IgnoreAttribute in TFS and MS Test runner is same like commenting whole test which is useless.
I like to think how you are describing Inconclusive is the proper usage.
Though in my experience, Inconclusive is treated more like a warning than an error. In fact, they are reported in the TRX separately from errors:
I typically run the mstest executable from an <Exec> task in my msbuild script and then peek inside the TRX to determine whether it should fail the build.