Ejemplo n.º 1
0
 public void TestEDateInvalidValueEval()
 {
     ValueEval Evaluate = new EDate().Evaluate(new ValueEval[] { new ValueEval1() { }, new NumberEval(0) }, null);
     Assert.IsTrue(Evaluate is ErrorEval);
     Assert.AreEqual(ErrorEval.VALUE_INVALID, Evaluate);
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
        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");
        }