开发者

Method parameters have incorrect values when using RowTest in VB.Net

I have the following test method (VB.NET)

<RowTest()> _
<Row(1, 2, 3)> _
Public Sub AddMultipleNumbers(ByVal number1 As Intege开发者_StackOverflow中文版r, ByVal number2 As Integer, ByVal result As Integer)

    Dim dvbc As VbClass = New VbClass()

    Dim actual As Integer = dvbc.Add(number1, number2)

    Assert.That(actual, [Is].SameAs(result))
End Sub

My problem is that when the test runs, using TestDriven.Net, the three method parameters are 0 and not the values I am expecting. I have referenced the NUnit.Framework (v.2.5.3.9345) anf the NUnitExtension.RowTest (v.1.2.3.0).


Instead of using the RowTest extension, try using the TestCase parameterized test now built into NUnit.

I wrote a blog post showing how to convert from one to the other. It's in C# but should be easy enough to convert.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜