Ejemplo n.º 1
0
        public void SimpleFlow(IConnectionManager conn)
        {
            //Arrange
            TwoColumnsTableFixture source2Columns = new TwoColumnsTableFixture(conn, "dbsource_simple");

            source2Columns.InsertTestData();
            CreateViewTask.CreateOrAlter(conn, "DbSourceView", $"SELECT * FROM {conn.QB}dbsource_simple{conn.QE}");
            TwoColumnsTableFixture dest2Columns = new TwoColumnsTableFixture(conn, "DbDestinationSimple");

            //Act
            DbSource <MySimpleRow>      source = new DbSource <MySimpleRow>(conn, "DbSourceView");
            DbDestination <MySimpleRow> dest   = new DbDestination <MySimpleRow>(conn, "DbDestinationSimple");

            source.LinkTo(dest);
            source.Execute();
            dest.Wait();

            //Assert
            dest2Columns.AssertTestData();
        }
Ejemplo n.º 2
0
        public void DifferentColumnsInView(IConnectionManager conn)
        {
            //Arrange
            FourColumnsTableFixture s4c = new FourColumnsTableFixture(conn, "dbsource_extended");

            s4c.InsertTestData();
            CreateViewTask.CreateOrAlter(conn, "DbSourceViewExtended", $"SELECT {conn.QB}Col2{conn.QE}, {conn.QB}Col4{conn.QE} FROM {conn.QB}dbsource_extended{conn.QE}");
            FourColumnsTableFixture d4c = new FourColumnsTableFixture(conn, "DbDestinationExtended", 1);

            //Act
            DbSource <MyExtendedRow>      source = new DbSource <MyExtendedRow>(conn, "DbSourceViewExtended");
            DbDestination <MyExtendedRow> dest   = new DbDestination <MyExtendedRow>(conn, "DbDestinationExtended");

            source.LinkTo(dest);
            source.Execute();
            dest.Wait();

            //Assert
            d4c.AssertTestData();
        }
Ejemplo n.º 3
0
        public void DropIfExists(IConnectionManager connection)
        {
            //Arrange
            string viewtext = "SELECT 1 AS test";

            if (connection.GetType() == typeof(OracleConnectionManager))
            {
                viewtext += " FROM DUAL";
            }

            // Act
            DropViewTask.DropIfExists(connection, "DropIfExistsViewTest");

            //Arrange
            CreateViewTask.CreateOrAlter(connection, "DropIfExistsViewTest", viewtext);
            Assert.True(IfTableOrViewExistsTask.IsExisting(connection, "DropIfExistsViewTest"));

            //Act
            DropViewTask.DropIfExists(connection, "DropIfExistsViewTest");

            //Assert
            Assert.False(IfTableOrViewExistsTask.IsExisting(connection, "DropIfExistsViewTest"));
        }