public void TestCaseEvaluationExceptions() { var @operator = new ArithmeticMultiplyOperator(TypeConverter); ExpectArgumentNullException("context", () => @operator.Evaluate(null, 1, 2)); ExpectArgumentNullException("context", () => @operator.EvaluateLhs(null, 1, out object dummy)); }
public void TestCaseConstruction3() { var @operator = new ArithmeticMultiplyOperator("operator", TypeConverter); Assert.AreEqual("operator", @operator.Symbol); Assert.AreEqual(3, @operator.Precedence); Assert.AreEqual(Associativity.LeftToRight, @operator.Associativity); }
public void TestCaseEvaluation() { var @operator = new ArithmeticMultiplyOperator(TypeConverter); AssertEvaluation <double>(@operator, 1, long.MaxValue, long.MaxValue); AssertEvaluation <double>(@operator, long.MinValue, 0, 0); AssertEvaluation <double>(@operator, 1.5, 2, 1.50 * 2.00); AssertEvaluation <double>(@operator, 0.33, 0, 0.33 * 0); AssertEvaluation <double>(@operator, -100, 0.5, -100 * 0.5); }
public void TestCaseConstruction2() { var @operator = new ArithmeticMultiplyOperator(TypeConverter); Assert.AreEqual("*", @operator.Symbol); }