public void TestCreateIndex() { string indexName = "ix_" + TestHelper.RandomString(5); CreateIndexTask.Create(indexName, "test.Table1", new List <string>() { "key1", "key2" }); Assert.IsTrue(SqlTask.ExecuteScalarAsBool("Check if index exists", $"select count(*) from sys.indexes where name = '{indexName}'")); }
public void TestLogging() { CreateLogTablesTask.CreateLog(); CreateIndexTask.Create("ix_" + TestHelper.RandomString(5), "test.Table1", new List <string>() { "key1", "key2" }); Assert.AreEqual(2, new SqlTask("Find log entry", "select count(*) from etl.Log where TaskType='CREATEINDEX' group by TaskHash") { DisableLogging = true }.ExecuteScalar <int>()); }