Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
        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);
        }
Пример #6
0
        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);
        }
Пример #7
0
        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);
        }
Пример #8
0
        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);
        }
Пример #9
0
        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);
        }
Пример #10
0
        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);
        }
Пример #11
0
        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);
        }
Пример #12
0
        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);
        }
Пример #13
0
        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);
        }
Пример #14
0
        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);
        }
Пример #15
0
        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);
        }
Пример #16
0
        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);
        }
Пример #17
0
        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);
        }
Пример #18
0
        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);
        }
Пример #19
0
        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);
        }
Пример #20
0
        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);
        }
Пример #21
0
        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);
        }
Пример #22
0
        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);
        }
Пример #23
0
        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);
        }
Пример #24
0
        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);
        }
Пример #25
0
        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);
        }
Пример #26
0
        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);
        }
Пример #27
0
        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);
        }
Пример #28
0
        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);
        }
Пример #29
0
        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);
        }
Пример #30
0
        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);
        }