public static void Seed(this ICherrySeeder seeder, string entityName, Table table) { var cherrySeeder = seeder as CherrySeeder; var dataProvider = cherrySeeder.DataProvider as SpecFlowDataProvider; if (dataProvider == null) { throw new ConfigurationException("CherrySeed has an uncorrect SpecFlow configuration. Call method WithSpecFlowConfiguration() in the CherrySeed configuration section.", null); } dataProvider.ClearAndAdd(entityName, table); seeder.Seed(); }
public void InitAndSeed(IDataProvider dataProvider, IRepository repository, Action <ISeederConfigurationBuilder> entitySettings) { var config = new CherrySeedConfiguration(cfg => { cfg.WithDataProvider(dataProvider); cfg.WithRepository(repository); entitySettings(cfg); }); _cherrySeeder = config.CreateSeeder(); _cherrySeeder.Seed(); }
public void GivenTheFollowingEntriesOfCountryExist(Table table) { _cherrySeeder.Seed("Country", table); }