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:
We are doing this because:
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:
<TestRun>
<ResultSummary outcome="Inconclusive">
<Counters total="1"
executed="0" error="0" failed="0"
timeout="0" aborted="0" inconclusive="1"
passedButRunAborted="0" notRunnable="0"
notExecuted="0" disconnected="0"
warning="0" passed="0" completed="0"
inProgress="0" pending="0" />
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.