Exemplo n.º 1
0
        static TestDatabaseGenerator() {
            // delete the sqlite db if exists
            if (File.Exists("testdb.db")) {
                File.Delete("testdb.db");
            }

            // generate all the sessions
            var configurationTypes = Assembly.GetExecutingAssembly().GetTypes().Where(t => t.Namespace == "Dashing.IntegrationTests.Setup" && typeof(IConfiguration).IsAssignableFrom(t)).ToArray();
            foreach (var configurationType in configurationTypes) {
                var configuration = (IConfiguration)Activator.CreateInstance(configurationType);
                var dbInitializer = new DatabaseInitializer(configuration);
                TestSessions.Add(dbInitializer.Initialize());
            }
        }
Exemplo n.º 2
0
        static TestDatabaseGenerator()
        {
            // delete the sqlite db if exists
            if (File.Exists("testdb.db"))
            {
                File.Delete("testdb.db");
            }

            // generate all the sessions
            var configurationTypes = Assembly.GetExecutingAssembly().GetTypes().Where(t => t.Namespace == "Dashing.IntegrationTests.Setup" && typeof(IConfiguration).IsAssignableFrom(t)).ToArray();

            foreach (var configurationType in configurationTypes)
            {
                var configuration = (IConfiguration)Activator.CreateInstance(configurationType);
                var dbInitializer = new DatabaseInitializer(configuration);
                TestSessions.Add(dbInitializer.Initialize());
            }
        }
Exemplo n.º 3
0
        static TestDatabaseGenerator()
        {
            // delete the sqlite db if exists
            if (File.Exists("testdb.db"))
            {
                File.Delete("testdb.db");
            }

            // generate all the sessions
            var sessionCreatorTypes = typeof(TestDatabaseGenerator).Assembly().GetTypes().Where(t => t.Namespace == "Dashing.IntegrationTests.Setup" && typeof(IDatabase).IsAssignableFrom(t) && t.IsPublic()).ToArray();
            var config = new Configuration();

            foreach (var sessionCreatorType in sessionCreatorTypes)
            {
                var sessionCreator = (SqlDatabase)Activator.CreateInstance(sessionCreatorType, config);
                var dbInitializer  = new DatabaseInitializer(sessionCreator, config);
                TestSessions.Add(dbInitializer.Initialize());
            }
        }