Ejemplo n.º 1
0
        public void TestBadRemove()
        {
            var s   = new StatementInlineBlock();
            var tmp = new StatementSimpleStatement("fork");

            s.Remove(tmp);
        }
        public void TestRemoveSingleStatementResetsParent()
        {
            var s = new StatementInlineBlock();
            var s1 = new StatementSimpleStatement("one");
            var s2 = new StatementSimpleStatement("two");
            s.Add(s1);
            s.Add(s2);

            s.Remove(s1);
            Assert.IsNull(s1.Parent, "s1 parent");
        }
        public void TestRemoveSingleStatement()
        {
            var s = new StatementInlineBlock();
            var s1 = new StatementSimpleStatement("one");
            var s2 = new StatementSimpleStatement("two");
            s.Add(s1);
            s.Add(s2);

            s.Remove(s1);
            Assert.AreEqual(1, s.Statements.Count(), "# of statements after remove");
            Assert.AreEqual(s2, s.Statements.First(), "First statement");
        }
Ejemplo n.º 4
0
        public void TestRemoveSingleStatementResetsParent()
        {
            var s  = new StatementInlineBlock();
            var s1 = new StatementSimpleStatement("one");
            var s2 = new StatementSimpleStatement("two");

            s.Add(s1);
            s.Add(s2);

            s.Remove(s1);
            Assert.IsNull(s1.Parent, "s1 parent");
        }
Ejemplo n.º 5
0
        public void TestRemoveSingleStatement()
        {
            var s  = new StatementInlineBlock();
            var s1 = new StatementSimpleStatement("one");
            var s2 = new StatementSimpleStatement("two");

            s.Add(s1);
            s.Add(s2);

            s.Remove(s1);
            Assert.AreEqual(1, s.Statements.Count(), "# of statements after remove");
            Assert.AreEqual(s2, s.Statements.First(), "First statement");
        }
 public void TestBadRemove()
 {
     var s = new StatementInlineBlock();
     var tmp = new StatementSimpleStatement("fork");
     s.Remove(tmp);
 }