Exemplo n.º 1
0
        private void ValidateRelationalOperators(RelationalOperatorCount operatorCount)
        {
            Assert.AreEqual(
                expected: operatorCount.EqualityCount,
                actual: NodeCount <IEqualityNode>(),
                message: "incorrect number of '==' operations");

            Assert.AreEqual(
                expected: operatorCount.InequalityCount,
                actual: NodeCount <IInequalityNode>(),
                message: "incorrect number of '!=' operations");

            Assert.AreEqual(
                expected: operatorCount.GreaterThanCount,
                actual: NodeCount <IGreaterThanNode>(),
                message: "incorrect number of '>' operations");

            Assert.AreEqual(
                expected: operatorCount.GreaterOrEqualCount,
                actual: NodeCount <IGreaterOrEqualNode>(),
                message: "incorrect number of '>=' operations");

            Assert.AreEqual(
                expected: operatorCount.LessThanCount,
                actual: NodeCount <ILessThanNode>(),
                message: "incorrect number of '<' operations");

            Assert.AreEqual(
                expected: operatorCount.LessOrEqualCount,
                actual: NodeCount <ILessOrEqualNode>(),
                message: "incorrect number of '<=' operations");
        }
Exemplo n.º 2
0
 public void WhenCalculationUsedInACondition_ParsesCorrectly(
     string validText,
     IEnumerable <string> expectedCalculationDefinitions,
     IEnumerable <string> expectedExpressions,
     IEnumerable <string> expectedVariables,
     RelationalOperatorCount operatorCount)
 {
     CreateForm(validText);
     ValidateRelationalDefinition(expectedCalculationDefinitions);
     ValidateVariableNames(expectedVariables);
     ValidateMathExpressions(expectedExpressions);
     ValidateRelationalOperators(operatorCount);
 }
Exemplo n.º 3
0
 public void WhenDateComparisonUsedInACondition_ParsesCorrectly(
     string validText,
     IEnumerable <string> expectedCalculationDefinitions,
     IEnumerable <DateTime> expectedLiterals,
     IEnumerable <string> expectedVariables,
     RelationalOperatorCount operatorCount)
 {
     CreateForm(validText);
     ValidateRelationalDefinition(expectedCalculationDefinitions);
     ValidateVariableNames(expectedVariables);
     ValidateDateLiterals(expectedLiterals);
     ValidateRelationalOperators(operatorCount);
 }