Example #1
0
 public static void TestInit(TestContext testContext)
 {
     ControlFlow.ClearSettings();
     TestHelper.RecreateDatabase(testContext);
     ControlFlow.CurrentDbConnection = new SqlConnectionManager(new ConnectionString(testContext.Properties["connectionString"].ToString()));
     CreateLogTablesTask.CreateLog();
 }
Example #2
0
 public static void TestInit(TestContext testContext)
 {
     TestHelper.RecreateDatabase(testContext);
     ControlFlow.CurrentDbConnection = new SqlConnectionManager(new ConnectionString(testContext.Properties["connectionString"].ToString()));
     CreateSchemaTask.Create("test");
     SqlTask.ExecuteNonQuery("Create test table", $@"create table test.Table1 ( key1 int null, key2 int not null)");
     SqlTask.ExecuteNonQuery("Create test table", $@"create table test.Table2 ( key1 int null, key2 int not null, value1 datetime null, value2 varchar(100) not null )");
 }
Example #3
0
        public static void TestInit(TestContext testContext)
        {
            TestHelper.RecreateDatabase(testContext);
            ControlFlow.CurrentDbConnection = new SqlConnectionManager(new ConnectionString(testContext.Properties["connectionString"].ToString()));
            CreateSchemaTask.Create("test");
            SqlTask.ExecuteNonQuery("Create test data table", $@"
create table test.RC ( value int null )
insert into test.RC select * from (values (1), (2), (3)) AS MyTable(v)");
        }
Example #4
0
 public void TestLogging()
 {
     TestHelper.RecreateDatabase(TestContext);
     CreateLogTablesTask.CreateLog();
     ProcessCubeTask.Process("Process cube test");
     Assert.AreEqual(2, new SqlTask("Find log entry", "select count(*) from etl.Log where TaskType='PROCESSCUBE' group by TaskHash")
     {
         DisableLogging = true
     }.ExecuteScalar <int>());
 }
        public static void ClassInit(TestContext testContext)
        {
            TestHelper.RecreateDatabase(testContext);
            TestHelper.RecreateDatabase(testContext.Properties["dbNameDest"].ToString(), testContext.Properties["connectionStringDest"].ToString());
            TestHelper.RecreateDatabase(testContext.Properties["dbNameLog"].ToString(), testContext.Properties["connectionStringLog"].ToString());

            new CreateSchemaTask("test")
            {
                ConnectionManager = new SqlConnectionManager(new ConnectionString(testContext.Properties["connectionString"].ToString()))
            }.Execute();
            new CreateSchemaTask("test")
            {
                ConnectionManager = new SqlConnectionManager(new ConnectionString(testContext.Properties["connectionStringDest"].ToString()))
            }.Execute();
        }
Example #6
0
 public void BeforeTests()
 {
     TestHelper.RecreateDatabase(TestContext);
     CreateLogTablesTask.CreateLog();
     Assert.IsFalse(new SqlTask("Check if logging was disabled for table creation", "select count(*) from etl.Log")
     {
         DisableLogging = true
     }.ExecuteScalarAsBool());
     Assert.IsTrue(new SqlTask("Check etl.Log table", $"select count(*) from sys.tables where type = 'U' and name = 'Log' and schema_id('etl') = schema_id")
     {
         DisableLogging = true
     }.ExecuteScalarAsBool());
     Assert.IsTrue(new SqlTask("Check etl.LoadProcess table", $"select count(*) from sys.tables where type = 'U' and name = 'LoadProcess' and schema_id('etl') = schema_id")
     {
         DisableLogging = true
     }.ExecuteScalarAsBool());
 }
Example #7
0
 public void BeforeTests()
 {
     TestHelper.RecreateDatabase(TestContext);
     CreateLogTablesTask.CreateLog();
     Assert.IsTrue(new SqlTask("Check proc StartLoadProcess", $"select count(*) from sys.procedures  where type = 'P' and name = 'StartLoadProcess' and schema_id = schema_id('etl')")
     {
         DisableLogging = true
     }.ExecuteScalarAsBool());
     Assert.IsTrue(new SqlTask("Check proc EndLoadProcess", $"select count(*) from sys.procedures  where type = 'P' and name = 'EndLoadProcess' and schema_id = schema_id('etl')")
     {
         DisableLogging = true
     }.ExecuteScalarAsBool());
     Assert.IsTrue(new SqlTask("Check proc AbortLoadProcess", $"select count(*) from sys.procedures  where type = 'P' and name = 'AbortLoadProcess' and schema_id = schema_id('etl')")
     {
         DisableLogging = true
     }.ExecuteScalarAsBool());
 }
Example #8
0
 public static void ClassInit(TestContext testContext)
 {
     TestHelper.RecreateDatabase(testContext);
     ControlFlow.CurrentDbConnection = new SqlConnectionManager(new ConnectionString(testContext.Properties["connectionString"].ToString()));
     CreateSchemaTask.Create("test");
 }
 public static void TestInit(TestContext testContext)
 {
     TestHelper.RecreateDatabase(testContext);
 }