简体   繁体   English

在VB.Net中使用RowTest时,方法参数的值不正确

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

I have the following test method (VB.NET) 我有以下测试方法(VB.NET)

<RowTest()> _
<Row(1, 2, 3)> _
Public Sub AddMultipleNumbers(ByVal number1 As Integer, 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. 我的问题是,使用TestDriven.Net进行测试时,三个方法参数为0,而不是我期望的值。 I have referenced the NUnit.Framework (v.2.5.3.9345) anf the NUnitExtension.RowTest (v.1.2.3.0). 我已经引用了NUnit.Framework(v.2.5.3.9345)和NUnitExtension.RowTest(v.1.2.3.0)。

Instead of using the RowTest extension, try using the TestCase parameterized test now built into NUnit. 而不是使用RowTest扩展,请尝试使用现在内置于NUnit中的TestCase参数化测试。

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. 它在C#中,但应该足够容易转换。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM