我有一个这样的测试:
[TestCase(12, Result= typeof(mytype))]
public mytype GetById(int id)
{
yada, yada, yada.
}
in the NUnit error window, I see this:
Test.Tester.GetById(12):
Expected: <mytype>
But was: <mytype>
我的问题是,这是预期的吗?当返回值是我自己的类型而不是整数、字符串等时,有没有办法指定返回值的类型?我在网上找到的所有示例都只返回字符串或整数。我是否需要实际生成一个 mytype 实例并说这是我所期望的?
这是 NUnit 2.5.9。