Ejemplo n.º 1
0
        public void NetworkdaysWithInvalidArgumentReturnsPoundValue()
        {
            var func = new Networkdays();

            var args   = FunctionsHelper.CreateArgs();
            var result = func.Execute(args, this.ParsingContext);

            Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type);
        }
Ejemplo n.º 2
0
        public void NetworkdaysFunctionWithErrorValuesAsInputReturnsTheInputErrorValue()
        {
            var func        = new Networkdays();
            var argNA       = FunctionsHelper.CreateArgs(ExcelErrorValue.Create(eErrorType.NA), 3);
            var argNAME     = FunctionsHelper.CreateArgs(ExcelErrorValue.Create(eErrorType.Name), 3);
            var argVALUE    = FunctionsHelper.CreateArgs(ExcelErrorValue.Create(eErrorType.Value), 3);
            var argNUM      = FunctionsHelper.CreateArgs(ExcelErrorValue.Create(eErrorType.Num), 3);
            var argDIV0     = FunctionsHelper.CreateArgs(ExcelErrorValue.Create(eErrorType.Div0), 3);
            var argREF      = FunctionsHelper.CreateArgs(ExcelErrorValue.Create(eErrorType.Ref), 3);
            var resultNA    = func.Execute(argNA, this.ParsingContext);
            var resultNAME  = func.Execute(argNAME, this.ParsingContext);
            var resultVALUE = func.Execute(argVALUE, this.ParsingContext);
            var resultNUM   = func.Execute(argNUM, this.ParsingContext);
            var resultDIV0  = func.Execute(argDIV0, this.ParsingContext);
            var resultREF   = func.Execute(argREF, this.ParsingContext);

            Assert.AreEqual(eErrorType.NA, ((ExcelErrorValue)resultNA.Result).Type);
            Assert.AreEqual(eErrorType.Name, ((ExcelErrorValue)resultNAME.Result).Type);
            Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)resultVALUE.Result).Type);
            Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)resultNUM.Result).Type);
            Assert.AreEqual(eErrorType.Div0, ((ExcelErrorValue)resultDIV0.Result).Type);
            Assert.AreEqual(eErrorType.Ref, ((ExcelErrorValue)resultREF.Result).Type);
        }