protected TestBase() { var config = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build(); var section = config.GetSection("ConnectionStrings").GetSection("huraceTest"); var provider = section["ProviderName"]; var connectionString = section["ConnectionString"]; ConnectionFactory = new ConcreteConnectionFactory(DbUtil.GetProviderFactory(provider), connectionString); RaceDao = new RaceDao(ConnectionFactory, StatementFactory); SeasonDao = new SeasonDao(ConnectionFactory, StatementFactory); LocationDao = new LocationDao(ConnectionFactory, StatementFactory); CountryDao = new CountryDao(ConnectionFactory, StatementFactory); DisciplineDao = new DisciplineDao(ConnectionFactory, StatementFactory); SkierDao = new SkierDao(ConnectionFactory, StatementFactory); StartListDao = new StartListDao(ConnectionFactory, StatementFactory); RaceEventDao = new RaceEventDao(ConnectionFactory, StatementFactory); SkierEventDao = new SkierEventDao(ConnectionFactory, StatementFactory); TimeDataDao = new TimeDataDao(ConnectionFactory, StatementFactory); GenderDao = new GenderDao(ConnectionFactory, StatementFactory); SensorDao = new SensorDao(ConnectionFactory, StatementFactory); RaceDataDao = new RaceDataDao(ConnectionFactory, StatementFactory); RaceStateDao = new RaceStateDao(ConnectionFactory, StatementFactory); StartStateDao = new StartStateDao(ConnectionFactory, StatementFactory); EventTypeDao = new EventTypeDao(ConnectionFactory, StatementFactory); _dataGenerator = new DataGenerator.Core.DataGenerator(provider, connectionString); }
public async Task FindByIdTest() { var raceEvent = (await RaceEventDao.FindAllAsync()).First(); var raceEventById = await RaceEventDao.FindByIdAsync(raceEvent.Id); Assert.NotNull(raceEventById); Assert.NotNull(raceEventById?.RaceData); }
public async Task FindAllTest() => Assert.AreEqual(4, (await RaceEventDao.FindAllAsync()).Count());