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

testSubstSingleVariableSucceedsWithTermEquality() private method

private testSubstSingleVariableSucceedsWithTermEquality ( ) : void
return void
        public void testSubstSingleVariableSucceedsWithTermEquality()
        {
            Sentence beforeSubst = parser.parse("BrotherOf(x) = EnemyOf(y)");
            Sentence expectedAfterSubst = parser
                    .parse("BrotherOf(John) = EnemyOf(Saladin)");

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

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