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

testIsUnitClause() private method

private testIsUnitClause ( ) : void
return void
        public void testIsUnitClause()
        {
            Clause c1 = new Clause();
            Assert.IsFalse(c1.isUnitClause());

            c1.addPositiveLiteral(new Predicate("Pred1", new List<Term>()));
            Assert.IsTrue(c1.isUnitClause());

            c1.addPositiveLiteral(new Predicate("Pred2", new List<Term>()));
            Assert.IsFalse(c1.isUnitClause());

            c1 = new Clause();
            Assert.IsFalse(c1.isUnitClause());

            c1.addPositiveLiteral(new Predicate("Pred1", new List<Term>()));
            Assert.IsTrue(c1.isUnitClause());

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

            c1 = new Clause();
            Assert.IsFalse(c1.isUnitClause());

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

            c1.addPositiveLiteral(new Predicate("Pred2", new List<Term>()));
            Assert.IsFalse(c1.isUnitClause());
        }