コード例 #1
0
 protected bool ShouldIgnore(FunctionArgument arg)
 {
     if (IgnoreHiddenValues && arg.ExcelStateFlagIsSet(ExcelCellState.HiddenCell))
     {
         return(true);
     }
     return(false);
 }
コード例 #2
0
 protected bool ShouldIgnore(FunctionArgument arg)
 {
     if (IgnoreHiddenValues && arg.ExcelStateFlagIsSet(ExcelCellState.HiddenCell))
     {
         return true;
     }
     return false;
 }
コード例 #3
0
 public void ShouldSetExcelState()
 {
     var arg = new FunctionArgument(2);
     arg.SetExcelStateFlag(ExcelCellState.HiddenCell);
     Assert.IsTrue(arg.ExcelStateFlagIsSet(ExcelCellState.HiddenCell));
 }
コード例 #4
0
 public void ExcelStateFlagIsSetShouldReturnFalseWhenNotSet()
 {
     var arg = new FunctionArgument(2);
     Assert.IsFalse(arg.ExcelStateFlagIsSet(ExcelCellState.HiddenCell));
 }
コード例 #5
0
 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);
 }
コード例 #6
0
 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);
 }
コード例 #7
-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);
 }