views:

630

answers:

1

I am using gallio to integrate mbunit's test runner with the mstest test runner in visual studio. it works VERY well - except when I am running a test with multiple assert statements. The test will either pass or fail based on the FIRST assert statement. I know a lot of people are against multiple asserts, but they are unavoidable in cases such as rowtests and combinatorial tests which receive multiple lines of input. All tests will be run successfully if executed from gallio's icarus gui. Has anyone else come across/fixed this issue?

Edit: Here is a code sample

(I obviously get the same results in c#)

<Test()> _
<MultipleAsserts()> _
<Row(3, 3)> _
<Row(3, 17)> _
<Row(1, 2)> _
Public Sub MyRowTest(ByVal val1 As Int32, ByVal val2 As Int32)

    Assert.AreEqual(Of Int32)(val1, val2)

End Sub

When run through Visual Studio the test passes and I get:

MyRowTest(3,3) Duration: 0.016s,

Assertions: 2

+1  A: 

Ahh, I see. You meant that Visual Studio's Test View considers the test passed or failed based on only one row of a row-test. I don't think this has anything to do with multiple asserts.

The problem here is that Visual Studio's test model is very limited and is a poor fit for some MbUnit features. Even so, Gallio could do more to improve the usability of data-driven tests in Visual Studio.

I have opened an issue here: http://code.google.com/p/mb-unit/issues/detail?id=509

Jeff Brown
Awesome, thank you Jeff!
Jason Irwin