我想伪造我的复杂对象(具有5个对象属性的对象)以测试控制器中的post
方法。
当我使用FakeItEasy时,会得到null
s个对象,并且无法将该对象插入DbContext。
那么我该如何伪造呢?手动?
我的计算机DTO:
public class Computer
{
public long Id { get; set; }
public Processor processor { get; set; }
public ICollection<Memory> memories { get; set; }
public ICollection<Disk> disks { get; set; }
public MotherBoard motherBoard { get; set; }
public ICollection<GPU> gpus { get; set; }
}