public void Customize_ShouldAddOptionsBuilderToFixture(InMemoryContextCustomization customization, Fixture fixture) { fixture.Customize(customization); fixture.Customizations.Should() .ContainSingle(x => x.GetType() == typeof(InMemoryOptionsSpecimenBuilder)); }
public void SaveChanges_ShouldCreateCustomerRecord( InMemoryContextCustomization customization, Fixture fixture) { fixture.Customize( new CompositeCustomization( customization, new ConstructorCustomization( typeof(TestDbContext), new GreedyConstructorQuery()))); using var context = fixture.Create <TestDbContext>(); context.Database.EnsureCreated(); context.Customers.Add(new Customer("John Doe")); context.SaveChanges(); context.Customers.Should().Contain(x => x.Name == "John Doe"); }
public void Customize_ForNullFixture_ShouldThrow(InMemoryContextCustomization customization) { Action act = () => customization.Customize(default);