1
我如何让AutoFixture在包含接口属性的对象中填充属性?AutoFixture设置界面属性里面的类
public class Car : ICar
{
public string Name { get; set; }
public ICarinformation ContactInformation { get; set; } // problematic
...
public CarInformation: ICarinformation
{
public string Make {get; set; } // I would like these to be populated as well
...
fixture.Create()抛出:
类型的异常 'Ploeh.AutoFixture.ObjectCreationException' 发生Ploeh.AutoFixture.dll但在用户代码中没有处理
附加信息:AutoFixture无法从Mediachase.Commerce.Inventory.ICarInformation创建实例 ,因为它是一个 接口
有没有办法为该属性提供具有混凝土类型的AutoFixture?
真棒!像魅力一样工作 – ShaneKm