Example #1
0
        public void appending_child_converts_to_CTE()
        {
            var root       = new DummyStatement();
            var descendent = new DummyStatement();

            root.InsertAfter(descendent);

            root.Next.ShouldBe(descendent);
            descendent.Previous.ShouldBe(root);
        }
Example #2
0
        public when_inserting_statement_in_front_of_statement_that_is_not_the_top()
        {
            var session = Substitute.For <IMartenSession>();

            session.NextTempTableName().Returns("NextTempTable");

            root.InsertAfter(original);

            inserted = new DummyStatement();

            original.InsertBefore(inserted);
        }
Example #3
0
        public when_inserting_a_statement_before_an_unattached_statement()
        {
            var session = Substitute.For <IMartenSession>();

            session.NextTempTableName().Returns("NextTempTable");

            original = new DummyStatement
            {
                Mode = StatementMode.Select
            };

            newRoot = new DummyStatement();


            original.InsertBefore(newRoot);
        }