Published by breki on 15 Jan 2009 at 11:05 am
Gallio: Setting Test Outcome Any Way You Like
In one of my previous posts I discussed using Assert.Inconclusive() method to mark tests as "not finished yet" during the execution of the test (as opposed to declaring test outcomes using attributes such as [Pending]).
It turns out there’s a better way to do this (which Jeff Brown kindly pointed me to):
SilentTestException allows you to mark the test with any outcome you like. Which is exactly what I was looking for.



igorbrejc.net » MbUnit: Inconclusive Test Results on 15 Jan 2009 at 11:13 #
[...] There is a better way: Gallio: Setting Test Outcome Anyway You Like [...]
Jeff Brown on 17 Jan 2009 at 12:08 #
Do you think we should offer some kind of new simple API to raise this exception similar to Assert.Inconclusive?
How about something Assert.Skip(TestOutcome outcome, string message) with a couple other simple.
So then you can write Assert.Skip(TestOutcome.Pending, “Can’t do this yet…”);
breki on 17 Jan 2009 at 16:22 #
Jeff,
Yes, something consistent would be nice. In fact I would suggest marking the Assert.Inconsistent() as obsolete, to unify the interface. Assert.Fail() should of course stay, since it’s used much more often (I guess).
breki on 17 Jan 2009 at 16:23 #
Heh I meant Assert.Inconclusive()….