public void EtlRunInfo()
        {
            var sourceModel = new TestModel();

            sourceModel.GetTable("Secondary", "Pet").EtlRunInfoDisabled();

            var targetModel = DwhDataDefinitionToRelationalModelConverter.Convert(sourceModel, "dbo");

            Assert.AreEqual(2, targetModel.Schemas.Count);
            Assert.AreEqual(1, targetModel["dbo"].Tables.Count);
            Assert.AreEqual(1, targetModel["secondary"].Tables.Count);
            Assert.AreEqual(3, targetModel["dbo"]["people"].Columns.Count);
            Assert.AreEqual(3, targetModel["secondary"]["PeT"].Columns.Count);
            Assert.AreEqual(1, targetModel["dbo"]["PEOPLE"].PrimaryKeyColumns.Count);
            Assert.AreEqual(1, targetModel["secondarY"]["pet"].PrimaryKeyColumns.Count);
            Assert.AreEqual(1, targetModel["dbo"]["PEOPLE"].ForeignKeys.Count);
            Assert.AreEqual(1, targetModel["SECONDARY"]["pet"].ForeignKeys.Count);

            Assert.IsFalse(targetModel["dbo"]["people"].GetEtlRunInfoDisabled());
            Assert.IsTrue(targetModel["secondary"]["PeT"].GetEtlRunInfoDisabled());

            Assert.IsTrue(targetModel["dbo"]["people"].GetHasHistoryTable());
            Assert.IsFalse(targetModel["secondary"]["PeT"].GetHasHistoryTable());

            Assert.IsFalse(targetModel["dbo"]["people"]["id"].GetHistoryDisabled());
            Assert.IsTrue(targetModel["dbo"]["people"]["name"].GetHistoryDisabled());

            Assert.IsTrue(targetModel["dbo"]["people"]["id"].GetRecordTimestampIndicator());
            Assert.IsFalse(targetModel["dbo"]["people"]["name"].GetRecordTimestampIndicator());

            Assert.IsNull(targetModel["dbo"]["people"].GetSourceTableNameOverride());
            Assert.AreEqual("animal", targetModel["secondary"]["pet"].GetSourceTableNameOverride());
        }
Exemplo n.º 2
0
        public override void Execute()
        {
            DatabaseDeclaration.GetTable("dbo", "Company").HasHistoryTable();

            var configuration = new DwhBuilderConfiguration();
            var model         = DwhDataDefinitionToRelationalModelConverter.Convert(DatabaseDeclaration, "dbo");

            DataDefinitionExtenderMsSql2016.Extend(DatabaseDeclaration, configuration);
            RelationalModelExtender.Extend(model, configuration);

            CreateDatabase(DatabaseDeclaration);

            Init(configuration, model);
            Update(configuration, model);
        }