public void WorkdayShouldReturnCorrectResultWithNegativeArg() { var inputDate = new DateTime(2016, 6, 15).ToOADate(); var expectedDate = new DateTime(2016, 5, 4).ToOADate(); var func = new Workday(); var args = FunctionsHelper.CreateArgs(inputDate, -30); var result = func.Execute(args, _parsingContext); Assert.AreEqual(DateTime.FromOADate(expectedDate), DateTime.FromOADate((double)result.Result)); }
public void WorkdayWithNegativeArgShouldReturnCorrectWhenArrayOfHolidayDatesIsSupplied() { var inputDate = new DateTime(2016, 7, 27).ToOADate(); var holidayDate1 = new DateTime(2016, 7, 11).ToOADate(); var holidayDate2 = new DateTime(2016, 7, 8).ToOADate(); var expectedDate = new DateTime(2016, 6, 13).ToOADate(); var func = new Workday(); var args = FunctionsHelper.CreateArgs(inputDate, -30, FunctionsHelper.CreateArgs(holidayDate1, holidayDate2)); var result = func.Execute(args, _parsingContext); Assert.AreEqual(expectedDate, result.Result); }
public void WorkdayShouldReturnCorrectResultWithFourDaysSupplied() { var inputDate = new DateTime(2014, 1, 1).ToOADate(); var expectedDate = new DateTime(2014, 1, 7).ToOADate(); var func = new Workday(); var args = FunctionsHelper.CreateArgs(inputDate, 4); var result = func.Execute(args, _parsingContext); Assert.AreEqual(expectedDate, result.Result); }