public void Setup() { fixture = new Fixture(); fixture.Customize(new AutoMoqCustomization() { GenerateDelegates = true, ConfigureMembers = true }); fixture.Behaviors.OfType <ThrowingRecursionBehavior>().ToList() .ForEach(b => fixture.Behaviors.Remove(b)); fixture.Behaviors.Add(new OmitOnRecursionBehavior(3)); repo = fixture.Freeze <Mock <IObjectRepository> >(); model = fixture.Build <MeasureConverters>().OmitAutoProperties().Create(); }
public void Setup() { fixture = new Fixture(); fixture.Customize(new AutoMoqCustomization()); connection = new SqliteConnection("DataSource=:memory:"); connection.Open(); var options = new DbContextOptionsBuilder <DatabaseContext>().UseSqlite(connection).Options; context = new DatabaseContext(options); Ext.CreateDatabase(context); //context.Database.EnsureCreated(); fixture.Inject(context); fixture.Inject(fixture.Build <ObjectRepositoryEF>().OmitAutoProperties().Create() as IObjectRepository); model = fixture.Build <MeasureConverters>().OmitAutoProperties().Create(); }
public void Tests() { var converter = new MeasureConverters(new ObjectRepositoryCache(new AppModel())); }