【发布时间】:2015-07-23 23:57:22
【问题描述】:
我试图编写一个测试来检查派生类中的方法没有被错误地覆盖。所以我尝试了以下方法。但无论我尝试什么,它似乎都不允许我“注入”我的对象。
[Theory]
[xxxData(new BaseClass())]
[xxxData(new DerivedClass())]
public void Test_Stuff(BaseClass obj)
{
// ...
}
【问题讨论】:
-
将复杂对象作为参数发送到测试方法complex types in Unit test的完整指南