尝试为我的方法创建单元测试,但似乎无法正确配置。我去新测试->单元测试向导->选择我的方法->填写测试方法值,但我总是得到 Assert.Inconclusive 失败。验证此测试方法的正确性。
这是一个示例方法:
namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
}
public int Mult(int a, int b)
{
return a * b;
}
}
}
和测试方法:
[TestMethod()]
public void MultTest()
{
Program target = new Program(); // TODO: Initialize to an appropriate value
int a = 4; // TODO: Initialize to an appropriate value
int b = 5; // TODO: Initialize to an appropriate value
int expected = 20; // TODO: Initialize to an appropriate value
int actual;
actual = target.Mult(a, b);
Assert.AreEqual(expected, actual);
Assert.Inconclusive("Verify the correctness of this test method.");
}
看起来很简单,但我错过了一些微不足道的东西吗?