AIMA.Test.Core.Unit.Logic.FOL.SubstVisitorTest.testSubstSingleVariableSucceedsWithTermEquality C# (CSharp) Méthode

testSubstSingleVariableSucceedsWithTermEquality() private méthode

private testSubstSingleVariableSucceedsWithTermEquality ( ) : void
Résultat 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)"));
        }