Exemplo n.º 1
0
        public void Bind()
        {
            ConstantTerm term  = new ConstantTerm();
            ConstantTerm term2 = new ConstantTerm();

            term.Bind(term2);

            Assert.AreSame(term, term.Reference());
        }
Exemplo n.º 2
0
        public void Reference()
        {
            ConstantTerm term1 = new ConstantTerm();
            ConstantTerm term2 = new ConstantTerm();

            term1.Bind(term2);

            Assert.AreSame(term1, term1.Reference());
        }
Exemplo n.º 3
0
        public void Unbind()
        {
            AbstractTerm term = new AbstractTerm();
            ConstantTerm con  = new ConstantTerm("ali");

            term.Assign(con);

            term.Unbind();

            Assert.AreNotSame(term.Reference(), con.Reference());
        }
Exemplo n.º 4
0
        public void Unify_ref_con()
        {
            AbstractTerm term = new AbstractTerm();
            ConstantTerm con  = new ConstantTerm();

            Assert.IsTrue(term.Unify(con));

            Assert.AreEqual(term.Data(), con.Data());
            Assert.AreSame(term.Reference(), con.Reference());
            Assert.IsTrue(term.IsConstant);
            Assert.IsFalse(term.IsReference);
        }
Exemplo n.º 5
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);
        }