public void TestCaseEvaluationExceptions() { var @operator = new ArithmeticModuloOperator(TypeConverter); ExpectArgumentNullException("context", () => @operator.Evaluate(null, 1, 2)); ExpectArgumentNullException("context", () => @operator.EvaluateLhs(null, 1, out object dummy)); }
public void TestCaseConstruction3() { var @operator = new ArithmeticModuloOperator("operator", TypeConverter); Assert.AreEqual("operator", @operator.Symbol); Assert.AreEqual(3, @operator.Precedence); Assert.AreEqual(Associativity.LeftToRight, @operator.Associativity); }
public void TestCaseEvaluation() { var @operator = new ArithmeticModuloOperator(TypeConverter); AssertEvaluation <double, double>(@operator, 1.8, 2, 1.8); AssertEvaluation <double, double>(@operator, -5.5, 3, -2.5); AssertEvaluation <double, double>(@operator, 10, 3.5, 3); AssertEvaluation <double, double>(@operator, -100, -32.5, -2.5); AssertEvaluation <double, double>(@operator, int.MaxValue, int.MaxValue, 0); }
public void TestCaseConstruction2() { var @operator = new ArithmeticModuloOperator(TypeConverter); Assert.AreEqual("%", @operator.Symbol); }