public void Can_GetData()
        {
            var target    = new MsSqlReader();
            var dataTable = target.GetData(connectionString, "Select * from SalesLT.CustomerATeam  ");

            dataTable.Tables.Should().NotBeEmpty();
            dataTable.Tables[0].Rows.Should().NotBeEmpty();
        }
예제 #2
0
        public void CanUploadTable()
        {
            var manifestObject  = GetJsonFile <DatabaseJobManifest>(_inputRoot, "database.job.adventureWorks.json");
            var inputSqlQueries = GetJsonFile <TargetSql>(_inputRoot, "adventureWorks.target.customer.json");
            var data            = CreateTable();

            var target = new MsSqlWriter();

            target.UploadTable(connectionString,
                               inputSqlQueries.SetupTempDml,
                               manifestObject.manifest.tables[1],
                               data,
                               new List <string> {
                inputSqlQueries.UpdateFromTempDml, inputSqlQueries.ClearTempDml
            });

            var reader = new MsSqlReader();
            var result = reader.GetData(connectionString, $"select * from SalesLT.CustomerATeam");

            result.Tables.Should().NotBeEmpty();
            result.Tables[0].Rows.Should().NotBeEmpty();
        }