예제 #1
0
 private static bool errorCodesAreEqual(ErrorEval a, ErrorEval b)
 {
     if (a == b)
     {
         return true;
     }
     return a.ErrorCode == b.ErrorCode;
 }
예제 #2
0
 private void ConfirmPercentile(ValueEval percentile, ValueEval[] args, ErrorEval expectedError)
 {
     ValueEval result = invokePercentile(args, percentile);
     Assert.AreEqual(typeof(ErrorEval), result.GetType());
     Assert.AreEqual(expectedError.ErrorCode, ((ErrorEval)result).ErrorCode);
 }
예제 #3
0
 public EvalEx(ErrorEval error)
 {
     _error = error;
 }
예제 #4
0
 public EvaluationException(ErrorEval errorEval)
 {
     _errorEval = errorEval;
 }
예제 #5
0
 private void ConfirmError(ValueEval xArray, ValueEval yArray, ErrorEval expectedError)
 {
     ConfirmError(SUM_SQUARES, xArray, yArray, expectedError);
     ConfirmError(DIFF_SQUARES, xArray, yArray, expectedError);
     ConfirmError(SUM_SQUARES_OF_DIFFS, xArray, yArray, expectedError);
 }
예제 #6
0
 private void ConfirmError(Function function, ValueEval xArray, ValueEval yArray, ErrorEval expectedError)
 {
     ValueEval result = invoke(function, xArray, yArray);
     Assert.AreEqual(typeof(ErrorEval), result.GetType());
     Assert.AreEqual(expectedError.ErrorCode, ((ErrorEval)result).ErrorCode);
 }
예제 #7
0
파일: TestAverage.cs 프로젝트: 89sos98/npoi
 private void ConfirmAverage(ValueEval[] args, ErrorEval expectedError)
 {
     ValueEval result = InvokeAverage(args);
     Assert.AreEqual(typeof(ErrorEval), result.GetType());
     Assert.AreEqual(expectedError.ErrorCode, ((ErrorEval)result).ErrorCode);
 }
예제 #8
0
 public EvaluationException(ErrorEval errorEval)
 {
     _errorEval = errorEval;
 }
예제 #9
0
파일: TestMid.cs 프로젝트: ctddjyds/npoi
 private void ConfirmMid(ValueEval text, ValueEval startPos, ValueEval numChars, ErrorEval expectedError)
 {
     ValueEval result = invokeMid(text, startPos, numChars);
     Assert.AreEqual(typeof(ErrorEval), result.GetType());
     Assert.AreEqual(expectedError.ErrorCode, ((ErrorEval)result).ErrorCode);
 }
예제 #10
0
 private void ConfirmError(ValueEval xArray, ValueEval yArray, ErrorEval expectedError)
 {
     ConfirmError(INTERCEPT, xArray, yArray, expectedError);
 }
예제 #11
0
 private static void ConfirmValueError(String msg, String numerator, String denominator, ErrorEval numError)
 {
     ValueEval result = invokeValue(numerator, denominator);
     Assert.AreEqual(typeof(ErrorEval), result.GetType());
     Assert.AreEqual(numError, result, msg);
 }
예제 #12
0
 private static void Confirm(IFormulaEvaluator fe, ICell cell, String formula,
         ErrorEval expectedResult)
 {
     fe.ClearAllCachedResultValues();
     cell.CellFormula=(formula);
     CellValue cv = fe.Evaluate(cell);
     if (cv.CellType != CellType.Error)
     {
         throw new AssertionException("expected error cell type but got " + cv.FormatAsString());
     }
     int expCode = expectedResult.ErrorCode;
     if (cv.ErrorValue != expCode)
     {
         throw new AssertionException("Expected error '" + ErrorEval.GetText(expCode)
                 + "' but got '" + cv.FormatAsString() + "'.");
     }
 }
예제 #13
0
 private void ConfirmError(ValueEval xArray, ValueEval yArray, ErrorEval expectedError)
 {
     ConfirmError(SLOPE, xArray, yArray, expectedError);
 }
예제 #14
0
 private static void ConfirmPredicate(bool expectedResult, I_MatchPredicate matchPredicate, ErrorEval value)
 {
     Assert.AreEqual(expectedResult, matchPredicate.Matches(value));
 }
예제 #15
0
파일: TestDec2Hex.cs 프로젝트: mdjasim/npoi
 private static void ConfirmValueError(String msg, String number1, String number2, ErrorEval numError)
 {
     ValueEval result = invokeValue(number1, number2);
     Assert.AreEqual(typeof(ErrorEval), result.GetType());
     Assert.AreEqual(numError, result, msg);
 }
예제 #16
0
 private static String formatErrorMessage(ErrorEval ee)
 {
     if (errorCodesAreEqual(ee, ErrorEval.VALUE_INVALID))
     {
         return "Error code: #VALUE! (invalid value)";
     }
     return "Error code=" + ee.ErrorCode;
 }
예제 #17
0
파일: TestLen.cs 프로젝트: ctddjyds/npoi
 private void ConfirmLen(ValueEval text, ErrorEval expectedError)
 {
     ValueEval result = invokeLen(text);
     Assert.AreEqual(typeof(ErrorEval), result.GetType());
     Assert.AreEqual(expectedError.ErrorCode, ((ErrorEval)result).ErrorCode);
 }
예제 #18
0
 private static void ConfirmValueError(String msg, String real_num, String i_num, String suffix, ErrorEval numError)
 {
     ValueEval result = invokeValue(real_num, i_num, suffix);
     Assert.AreEqual(typeof(ErrorEval), result.GetType());
     Assert.AreEqual( numError, result, msg);
 }