private void checkValue(int startDate, int monthInc, double expectedResult) { EDate eDate = new EDate(); NumberEval result = (NumberEval)eDate.Evaluate(new ValueEval[] { new NumberEval(startDate), new NumberEval(monthInc) }, null); Assert.AreEqual(expectedResult, result.NumberValue); }
public void TestRefEvalStartDate() { EDate eDate = new EDate(); NumberEval result = (NumberEval)eDate.Evaluate(new ValueEval[] { new RefEvalImplementation(new NumberEval(1000)), new NumberEval(0) }, null); Assert.AreEqual(1000d, result.NumberValue); }
public void TestEDateBlankRefValueEval() { EDate eDate = new EDate(); NumberEval result = (NumberEval)eDate.Evaluate(new ValueEval[] { new RefEvalImplementation(BlankEval.instance), new NumberEval(0) }, null); Assert.AreEqual(-1.0d, result.NumberValue, "0 startDate triggers BAD_DATE currently, thus -1.0!"); result = (NumberEval)eDate.Evaluate(new ValueEval[] { new NumberEval(1), new RefEvalImplementation(BlankEval.instance) }, null); Assert.AreEqual(1.0d, result.NumberValue, "Blank is handled as 0 otherwise"); }