0

I'm trying to create a fake of a DbSet that represents the fact table in a star schema database. Here's a simplified example where AutoFixture throws a 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();
    }
}

Is it possible to create a FctAssumption using AutoFixture?

reggaeguitar
  • 1,795
  • 1
  • 27
  • 48

0 Answers0