AIMA.Test.Core.Unit.Logic.FOL.SubstVisitorTest.testSubstSingleVariableSucceedsWithPredicate C# (CSharp) Method

testSubstSingleVariableSucceedsWithPredicate() private method

private testSubstSingleVariableSucceedsWithPredicate ( ) : void
return void
        public void testSubstSingleVariableSucceedsWithPredicate()
        {
            Sentence beforeSubst = parser.parse("King(x)");
            Sentence expectedAfterSubst = parser.parse(" King(John) ");
            Sentence expectedAfterSubstCopy = (Sentence)expectedAfterSubst.copy();

            Assert.AreEqual(expectedAfterSubst, expectedAfterSubstCopy);
            Dictionary<Variable, Term> p = new Dictionary<Variable, Term>();
            p.Add(new Variable("x"), new Constant("John"));

            Sentence afterSubst = sv.subst(p, beforeSubst);
            Assert.AreEqual(expectedAfterSubst, afterSubst);
            Assert.AreEqual(beforeSubst, parser.parse("King(x)"));
        }