private static bool errorCodesAreEqual(ErrorEval a, ErrorEval b) { if (a == b) { return true; } return a.ErrorCode == b.ErrorCode; }
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); }
public EvalEx(ErrorEval error) { _error = error; }
public EvaluationException(ErrorEval errorEval) { _errorEval = errorEval; }
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); }
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); }
private void ConfirmAverage(ValueEval[] args, ErrorEval expectedError) { ValueEval result = InvokeAverage(args); Assert.AreEqual(typeof(ErrorEval), result.GetType()); Assert.AreEqual(expectedError.ErrorCode, ((ErrorEval)result).ErrorCode); }
public EvaluationException(ErrorEval errorEval) { _errorEval = errorEval; }
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); }
private void ConfirmError(ValueEval xArray, ValueEval yArray, ErrorEval expectedError) { ConfirmError(INTERCEPT, xArray, yArray, expectedError); }
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); }
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() + "'."); } }
private void ConfirmError(ValueEval xArray, ValueEval yArray, ErrorEval expectedError) { ConfirmError(SLOPE, xArray, yArray, expectedError); }
private static void ConfirmPredicate(bool expectedResult, I_MatchPredicate matchPredicate, ErrorEval value) { Assert.AreEqual(expectedResult, matchPredicate.Matches(value)); }
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); }
private static String formatErrorMessage(ErrorEval ee) { if (errorCodesAreEqual(ee, ErrorEval.VALUE_INVALID)) { return "Error code: #VALUE! (invalid value)"; } return "Error code=" + ee.ErrorCode; }
private void ConfirmLen(ValueEval text, ErrorEval expectedError) { ValueEval result = invokeLen(text); Assert.AreEqual(typeof(ErrorEval), result.GetType()); Assert.AreEqual(expectedError.ErrorCode, ((ErrorEval)result).ErrorCode); }
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); }