public void TestDontMatchConstant() { IConstant input = Polynomial.CreateConstant(1.5); var m = new TypeMatchTemplate<INamedVariable>(); var result = m.TryMatch(input); Assert.IsNull(result); }
public void TestDontMatchAssignment() { AbstractExpr input = Polynomial.CreateConstant(-1).C + Polynomial.CreateConstant(1).C * Polynomial.CreateConstant(2); BinaryExpressionTemplate template = new TypeMatchTemplate<IVariable>() + new TypeMatchTemplate<AbstractExpr>(); IDictionary<AbstractExpressionTemplate, IAbstractExpr> result = template.TryMatch(input); Assert.IsNull(result); }
public void TestMatchConstant() { IConstant input = Polynomial.CreateConstant(1.5); var m = new TypeMatchTemplate<IConstant>(); var result = m.TryMatch(input); Assert.AreSame(result[m], input); }