Пример #1
0
        public void Dereference()
        {
            ConstantTerm term1 = new ConstantTerm();
            ConstantTerm term2 = new ConstantTerm();
            ConstantTerm term3 = new ConstantTerm();

            term2.Bind(term3);
            term1.Bind(term2);

            Assert.AreSame(term1, term1.Dereference());
        }
Пример #2
0
        public void Assign()
        {
            AbstractTerm term = new AbstractTerm();
            ConstantTerm con  = new ConstantTerm("ali");

            term.Assign(con);

            Assert.AreSame(term.Dereference(), con);
            Assert.AreSame(term.Dereference(), con.Dereference());
            Assert.AreEqual(term.Data(), con.Data());
            Assert.AreSame(term.Reference(), con.Reference());
            Assert.IsFalse(term.IsList);
            Assert.IsFalse(term.IsObject);
            Assert.IsFalse(term.IsReference);
            Assert.IsFalse(term.IsStructure);
            Assert.IsTrue(term.IsConstant);
        }