AIMA.Test.Core.Unit.Logic.FOL.KB.Data.ClauseTest.testIsEmpty C# (CSharp) Method

testIsEmpty() private method

private testIsEmpty ( ) : void
return void
        public void testIsEmpty()
        {
            Clause c1 = new Clause();
            Assert.IsTrue(c1.isEmpty());

            c1.addNegativeLiteral(new Predicate("Pred1", new List<Term>()));
            Assert.IsFalse(c1.isEmpty());

            Clause c2 = new Clause();
            Assert.IsTrue(c2.isEmpty());

            c2.addPositiveLiteral(new Predicate("Pred1", new List<Term>()));
            Assert.IsFalse(c2.isEmpty());

            Clause c3 = new Clause();
            Assert.IsTrue(c3.isEmpty());

            c3.addNegativeLiteral(new Predicate("Pred1", new List<Term>()));
            c3.addPositiveLiteral(new Predicate("Pred1", new List<Term>()));
            // Should be empty as they resolved with each other
            Assert.IsFalse(c3.isEmpty());

            c3.addNegativeLiteral(new Predicate("Pred1", new List<Term>()));
            c3.addPositiveLiteral(new Predicate("Pred2", new List<Term>()));
            Assert.IsFalse(c3.isEmpty());
        }