Data() public method

public Data ( ) : object
return object
Example #1
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);
        }
Example #2
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);
        }
Example #3
0
        public void ConstantTerm()
        {
            ConstantTerm c = new ConstantTerm("Ali");

            Assert.AreEqual("Ali", c.Data());
        }
Example #4
0
 public void Data()
 {
     ConstantTerm t = new ConstantTerm();
     Assert.IsNull(t.Data());
 }
Example #5
0
        public void Unify_con_ref()
        {
            AbstractTerm term = new AbstractTerm();

            ConstantTerm con = new ConstantTerm("ali");

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

            Assert.AreSame(term.Data(), con.Data());
        }