我正在尝试创建一个代表星型模式数据库中事实表的DbSet。这是AutoFixture抛出NullReferenceException
的简化示例public class FctAssumption
{
public virtual DimAssumption DimAssumption { get; set; }
}
public class DimAssumption
{
public int Id { get; set; }
public virtual ICollection<FctAssumption> FctAssumptions { get; set; }
}
public class Class1
{
public static void Main()
{
var fixture = new Fixture();
var fake = fixture.Build<FctAssumption>()
.Without(x => x.DimAssumption.FctAssumptions)
.Create();
}
}
是否可以使用AutoFixture创建FctAssumption?