public void WorkdayIntlDateWithSlashesFirstInputAndNegativeDateInputReturnsCorrectInput() { var function = new WorkdayIntl(); var result = function.Execute(FunctionsHelper.CreateArgs("1-2-2017", -10), this.ParsingContext); Assert.AreEqual(42723.00, result.Result); }
public void WorkdayIntlWithHolidaysAsStringsReturnsCorrectValue() { var function = new WorkdayIntl(); var result = function.Execute(FunctionsHelper.CreateArgs("1/2/2017", 41, null, "1/25/2017"), this.ParsingContext); Assert.AreEqual(42795.00, result.Result); }
public void WorkdayIntlWithZeroFirstInputNegativeDateInputReturnsPoundNum() { var function = new WorkdayIntl(); var result = function.Execute(FunctionsHelper.CreateArgs(0, -10), this.ParsingContext); Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result.Result).Type); }
public void WorkdayIntlWithNullSecondParameterReturnsPoundNA() { var function = new WorkdayIntl(); var result = function.Execute(FunctionsHelper.CreateArgs("1/2/2017", null), this.ParsingContext); Assert.AreEqual(eErrorType.NA, ((ExcelErrorValue)result.Result).Type); }
public void WorkdayIntlWithNullFirstParamReturnsPoundNum() { var function = new WorkdayIntl(); var result = function.Execute(FunctionsHelper.CreateArgs(null, 10), this.ParsingContext); Assert.AreEqual(eErrorType.NA, ((ExcelErrorValue)result.Result).Type); }
public void WorkdayIntlWithEmptyFirstParameterAndNegativeDateInputReturnsPoundNA() { var function = new WorkdayIntl(); var result = function.Execute(FunctionsHelper.CreateArgs(null, -10), this.ParsingContext); Assert.AreEqual(eErrorType.NA, ((ExcelErrorValue)result.Result).Type); }
public void WorkdayIntlWithNullDayParameterReturnsPoundNA() { var function = new WorkdayIntl(); var startDate = new DateTime(2017, 1, 1); var result = function.Execute(FunctionsHelper.CreateArgs(startDate, null), this.ParsingContext); Assert.AreEqual(eErrorType.NA, ((ExcelErrorValue)result.Result).Type); }
public void WorkdayIntlWithDateAsStringAndNegativeDayInputReturnsCorrectValue() { var function = new WorkdayIntl(); var inputDate = "1/2/2017"; var result = function.Execute(FunctionsHelper.CreateArgs(inputDate, -10), this.ParsingContext); Assert.AreEqual(42723.00, result.Result); }
public void WorkdayIntlWithDATEFunctionAndNegativeDayInputReturnsCorrectResult() { var function = new WorkdayIntl(); var inputDate = new DateTime(2017, 1, 2); var result = function.Execute(FunctionsHelper.CreateArgs(inputDate, -10), this.ParsingContext); Assert.AreEqual(42723.00, result.Result); }
public void WorkdayIntlWithDateUsingDashesInsteadOfSlashesReturnsCorrectResult() { var function = new WorkdayIntl(); var input = "1-2-2017"; var result = function.Execute(FunctionsHelper.CreateArgs(input, 10), this.ParsingContext); Assert.AreEqual(42751.00, result.Result); }
public void WorkdayIntlWithDayParameterAsOADateReturnCorrectValue() { var function = new WorkdayIntl(); var startDate = new DateTime(2017, 1, 1); var result = function.Execute(FunctionsHelper.CreateArgs(startDate, 42748), this.ParsingContext); Assert.AreEqual(102582.00, result.Result); }
public void WorkdayIntlWithPositiveArgsAndNullHolidayDatesReturnsCorrectValue() { var function = new WorkdayIntl(); var inputDate = new DateTime(2017, 1, 2); var result = function.Execute(FunctionsHelper.CreateArgs(inputDate, 10, null, null), this.ParsingContext); Assert.AreEqual(42751.00, result.Result); }
public void WorkdayIntlWithIntegerInputReturnsCorrectValue() { var function = new WorkdayIntl(); var input = 10; var result = function.Execute(FunctionsHelper.CreateArgs(input, 10), this.ParsingContext); Assert.AreEqual(24.00, result.Result); }
public void WorkdayIntlWithNonZeroIntegerAsHolidayInputReturnsCorrectValue() { var function = new WorkdayIntl(); var inputDate = new DateTime(2017, 1, 2); var result = function.Execute(FunctionsHelper.CreateArgs(inputDate, 5, 1, 1), this.ParsingContext); Assert.AreEqual(42744.00, result.Result); }
public void WorkdayIntlWithNegativeIntAsHolidayInputReturnsPoundNum() { var function = new WorkdayIntl(); var inputDate = new DateTime(2017, 1, 2); var result = function.Execute(FunctionsHelper.CreateArgs(inputDate, 10, 1, -1), this.ParsingContext); Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result.Result).Type); }
public void WorkdayIntlWithHolidayWithDashesInsteadOfSlashesReturnsCorrectValue() { var function = new WorkdayIntl(); var inputDate = new DateTime(2017, 1, 2); var result = function.Execute(FunctionsHelper.CreateArgs(inputDate, 41, 1, "1-25-2017"), this.ParsingContext); Assert.AreEqual(42795.00, result.Result); }
public void WorkdayIntlWithInvalidArgumentReturnsPoundValue() { var function = new WorkdayIntl(); var args = FunctionsHelper.CreateArgs(); var result = function.Execute(args, this.ParsingContext); Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type); }
public void WorkdayIntlWithFractionAsStringInputReturnsCorrectValue() { var function = new WorkdayIntl(); var input = "0.5"; var result = function.Execute(FunctionsHelper.CreateArgs(input, 15), this.ParsingContext); Assert.AreEqual(20.00, result.Result); }
public void WorkdayIntlWithZeroAsDateParameterReuturnsCorrectValeue() { var function = new WorkdayIntl(); var startDate = new DateTime(2017, 1, 1); var result = function.Execute(FunctionsHelper.CreateArgs(startDate, 0), this.ParsingContext); Assert.AreEqual(42736.00, result.Result); }
public void WorkdayIntlWithDATEFunctionAsInputReturnsCorrectValue() { var function = new WorkdayIntl(); var input = new DateTime(2017, 1, 2); var result = function.Execute(FunctionsHelper.CreateArgs(input, 10), this.ParsingContext); Assert.AreEqual(42751.00, result.Result); }
public void WorkdayIntlWithDayParameterTypedWithQuotesReturnsCorrectResult() { var function = new WorkdayIntl(); var daysInput = "1/13/2017"; var startDate = new DateTime(2017, 1, 1); var result = function.Execute(FunctionsHelper.CreateArgs(startDate, daysInput), this.ParsingContext); Assert.AreEqual(102582.00, result.Result); }
public void WorkdayIntlWithDayParameterWithDashInsteadOfSlashForDateReturnsCorrectValue() { var function = new WorkdayIntl(); var startDate = new DateTime(2017, 1, 1); var dayInput = "1-13-2017"; var result = function.Execute(FunctionsHelper.CreateArgs(startDate, dayInput), this.ParsingContext); Assert.AreEqual(102582.00, result.Result); }
public void WorkdayIntlWithDecimalAsWeekendCodeReturnsPoundNum() { var function = new WorkdayIntl(); var inputDate = new DateTime(2013, 11, 23).ToOADate(); var args = FunctionsHelper.CreateArgs(inputDate, 20, 0.1); var result = function.Execute(args, this.ParsingContext); Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result.Result).Type); }
public void WorkdayIntlWithIncorrectStringLengthWeekendCodeReturnsPoundValue() { var function = new WorkdayIntl(); var inputDate = new DateTime(2019, 5, 7).ToOADate(); var args = FunctionsHelper.CreateArgs(inputDate, 6, "10100"); var result = function.Execute(args, this.ParsingContext); Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type); }
public void WorkdayIntlFunctionWithOutOfRangeWeekendCodeReturnsPoundNum() { var function = new WorkdayIntl(); var inputDate = new DateTime(2017, 9, 18).ToOADate(); var args = FunctionsHelper.CreateArgs(inputDate, 30, 23); var result = function.Execute(args, this.ParsingContext); Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result.Result).Type); }
public void WorkdayIntlShouldReturnCorrectResultWithFourDaysSupplied() { var inputDate = new DateTime(2014, 1, 1).ToOADate(); var expectedDate = new DateTime(2014, 1, 7).ToOADate(); var function = new WorkdayIntl(); var args = FunctionsHelper.CreateArgs(inputDate, 4); var result = function.Execute(args, this.ParsingContext); Assert.AreEqual(expectedDate, result.Result); }
public void WorkdayIntlWithValidStringWeekendCodeReturnsCorrectResult() { var function = new WorkdayIntl(); var inputDate = new DateTime(2015, 12, 5).ToOADate(); var expectedDate = new DateTime(2015, 12, 19).ToOADate(); var args = FunctionsHelper.CreateArgs(inputDate, 10, "1100000"); var result = function.Execute(args, this.ParsingContext); Assert.AreEqual(expectedDate, result.Result); }
public void WorkdayIntlWithNegativeDayArgReturndCorrectResultsWithWeekendSupplied() { var function = new WorkdayIntl(); var inputDate = new DateTime(2017, 6, 25).ToOADate(); var expectedDate = new DateTime(2017, 6, 14).ToOADate(); var args = FunctionsHelper.CreateArgs(inputDate, -8, 1); var result = function.Execute(args, this.ParsingContext); Assert.AreEqual(expectedDate, result.Result); }
public void WorkdayIntlFunctionWithOmittedWeekendCodeReturnsCorrectResult() { var function = new WorkdayIntl(); var inputDate = new DateTime(2018, 1, 1).ToOADate(); var expectedDate = new DateTime(2018, 1, 18).ToOADate(); var args = FunctionsHelper.CreateArgs(inputDate, 13, null); var result = function.Execute(args, this.ParsingContext); Assert.AreEqual(expectedDate, result.Result); }
public void WorkdayIntlWithStringsAsHolidayInputReturnsPoundValue() { var function = new WorkdayIntl(); var inputDate = new DateTime(2017, 1, 2); var result1 = function.Execute(FunctionsHelper.CreateArgs(inputDate, 10, 1, "testString"), this.ParsingContext); var result2 = function.Execute(FunctionsHelper.CreateArgs(inputDate, 10, 1, ""), this.ParsingContext); Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result1.Result).Type); Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result2.Result).Type); }