Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        public DataGenerator(string providerName, string connectionString)
        {
            var connectionFactory =
                new ConcreteConnectionFactory(DbUtil.GetProviderFactory(providerName), connectionString);
            var statementFactory = new StatementFactory("hurace");

            _countryDao    = new CountryDao(connectionFactory, statementFactory);
            _locationDao   = new LocationDao(connectionFactory, statementFactory);
            _skierDao      = new SkierDao(connectionFactory, statementFactory);
            _disciplineDao = new DisciplineDao(connectionFactory, statementFactory);
            _raceDao       = new RaceDao(connectionFactory, statementFactory);
            _startListDao  = new StartListDao(connectionFactory, statementFactory);
            _raceDataDao   = new RaceDataDao(connectionFactory, statementFactory);
            _sensorDao     = new SensorDao(connectionFactory, statementFactory);
            _timeDataDao   = new TimeDataDao(connectionFactory, statementFactory);
            _raceDataDao   = new RaceDataDao(connectionFactory, statementFactory);
            _raceEventDao  = new RaceEventDao(connectionFactory, statementFactory);
            _skierEventDao = new SkierEventDao(connectionFactory, statementFactory);
            _seasonDao     = new SeasonDao(connectionFactory, statementFactory);
        }