protected bool ShouldIgnore(FunctionArgument arg) { if (IgnoreHiddenValues && arg.ExcelStateFlagIsSet(ExcelCellState.HiddenCell)) { return(true); } return(false); }
protected bool ShouldIgnore(FunctionArgument arg) { if (IgnoreHiddenValues && arg.ExcelStateFlagIsSet(ExcelCellState.HiddenCell)) { return true; } return false; }
public void ShouldSetExcelState() { var arg = new FunctionArgument(2); arg.SetExcelStateFlag(ExcelCellState.HiddenCell); Assert.IsTrue(arg.ExcelStateFlagIsSet(ExcelCellState.HiddenCell)); }
public void ExcelStateFlagIsSetShouldReturnFalseWhenNotSet() { var arg = new FunctionArgument(2); Assert.IsFalse(arg.ExcelStateFlagIsSet(ExcelCellState.HiddenCell)); }
public void TodayFunctionShouldReturnTodaysDate() { var func = new Today(); var args = new FunctionArgument[0]; var result = func.Execute(args, _parsingContext); var resultDate = DateTime.FromOADate((double)result.Result); Assert.AreEqual(DateTime.Now.Date, resultDate); }
public void RandShouldReturnAValueBetween0and1() { var func = new Rand(); var args = new FunctionArgument[0]; var result1 = func.Execute(args, _parsingContext); Assert.IsTrue(((double)result1.Result) > 0 && ((double) result1.Result) < 1); var result2 = func.Execute(args, _parsingContext); Assert.AreNotEqual(result1.Result, result2.Result, "The two numbers were the same"); Assert.IsTrue(((double)result2.Result) > 0 && ((double)result2.Result) < 1); }
public void NowFunctionShouldReturnNow() { var startTime = DateTime.Now; Thread.Sleep(1); var func = new Now(); var args = new FunctionArgument[0]; var result = func.Execute(args, _parsingContext); Thread.Sleep(1); var endTime = DateTime.Now; var resultDate = DateTime.FromOADate((double)result.Result); Assert.IsTrue(resultDate > startTime && resultDate < endTime); }