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

testSubstSingleVariableSucceedsWithTermEquality2() private method

private testSubstSingleVariableSucceedsWithTermEquality2 ( ) : void
return void
        public void testSubstSingleVariableSucceedsWithTermEquality2()
        {
            Sentence beforeSubst = parser.parse("BrotherOf(John) = x)");
            Sentence expectedAfterSubst = parser.parse("BrotherOf(John) = Richard");

            Dictionary<Variable, Term> p = new Dictionary<Variable, Term>();
            p.Add(new Variable("x"), new Constant("Richard"));
            p.Add(new Variable("y"), new Constant("Saladin"));

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