Complex attributes in MbUnit, Rowtest and Row

  • Thread starter Thread starter MJG
  • Start date Start date
M

MJG

With the MbUnit test framework there's a nice compact syntax for writing an
"array" of tests.

In C# this looks like:

[TestFixture]
public class DivisionFixture
{
[RowTest]
[Row(1000,10,100.0000)]
[Row(-1000,10,-100.0000)]
[Row(1000,7,142.85715)]
[Row(1000,0.00001,100000000)]
[Row(4195835,3145729,1.3338196)]
public void DivTest(double numerator, double denominator, double
result)
{
Assert.AreEqual(result, numerator / denominator, 0.00001 );
}
}

I'm attempting to use this in VB.NET but don't know the equivalent syntax.
Is it even possible?

I've tried things like:
<RowTest()><Row(1000, 10, 100.0)> Public Sub Test...

And a few variations but the syntax checker rejects them all!!


If you know about this I'd appreciate some insight.

Mike.
 
With the MbUnit test framework there's a nice compact syntax for writing an
"array" of tests.

In C# this looks like:

[TestFixture]
public class DivisionFixture
{
[RowTest]
[Row(1000,10,100.0000)]
[Row(-1000,10,-100.0000)]
[Row(1000,7,142.85715)]
[Row(1000,0.00001,100000000)]
[Row(4195835,3145729,1.3338196)]
public void DivTest(double numerator, double denominator, double
result)
{
Assert.AreEqual(result, numerator / denominator, 0.00001 );
}
}

I'm attempting to use this in VB.NET but don't know the equivalent syntax.
Is it even possible?

I've tried things like:
<RowTest()><Row(1000, 10, 100.0)> Public Sub Test...

<RowTest(), Row(1000,10,100.0000), Row(-1000,7,142.85715> _
Public Sub DivTest(

or you could still use '_' to put them on separate lines

<RowTest(), _
Row(1000,10,100.0000), _
Row(-1000,7,142.85715> _
Public SUb DivTest(
 
I tried that
<RowTest(), Row(1000,10,100.0000), Row(-1000,7,142.85715)>
style of syntax. It chokes on the bracketed parameters in Row.

I'd still like to know how, but this code goes to C#. Another project
needed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top