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); }
public void NowFunctionReturnsNow() { //Testing to make sure the Now Function returns the accurate date/time. var startTime = DateTime.Now; Thread.Sleep(1); var func = new Now(); var args = new FunctionArgument[0]; var result = func.Execute(args, this.ParsingContext); Thread.Sleep(1); var endTime = DateTime.Now; var resultDate = (DateTime)result.Result; Assert.IsTrue(resultDate > startTime && resultDate < endTime); }