protected override void OnModelCreating(ModelBuilder modelBuilder) { List <User> users = UserSeedLogic.Instance.PopulateUserList(200).ToList(); modelBuilder.Entity <User>().HasData(users); foreach (var user in users) { modelBuilder.Entity <Interest>().HasData(InterestSeedLogic.Instance.PopulateInterestList(user, RandomHelper.GetRandomShort(1, 6))); modelBuilder.Entity <Address>().HasData(AddressSeedFactory.Create(AddressType.Mailing).Populate(user)); modelBuilder.Entity <Address>().HasData(AddressSeedFactory.Create(AddressType.Billing).Populate(user)); } }
public void SeedLogic_Should_ReturnBillingAddress_Class() { IAddressSeed addressLogic = AddressSeedFactory.Create(AddressType.Billing); Assert.IsInstanceOfType(addressLogic, typeof(BillingAddressSeedLogic)); }