示例#1
0
        public void SumProductWithFalseBooleanInputReturnsPoundValue()
        {
            var function = new SumProduct();
            var result   = function.Execute(FunctionsHelper.CreateArgs(3, false), this.ParsingContext);

            Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type);
        }
示例#2
0
        public void SumProductWithIntegerInputsReturnsCorrectValue()
        {
            var function = new SumProduct();
            var result   = function.Execute(FunctionsHelper.CreateArgs(4, 5, 6), this.ParsingContext);

            Assert.AreEqual(120d, result.Result);
        }
示例#3
0
        public void SumProductWithDoubleInputsReturnsCorrectValue()
        {
            var function = new SumProduct();
            var result   = function.Execute(FunctionsHelper.CreateArgs(5.6, 5.7), this.ParsingContext);

            Assert.AreEqual(31.92d, (double)result.Result, 0.000001);
        }
示例#4
0
        public void SumProductWithDateAsStringInputReturnsCorrectValue()
        {
            var function = new SumProduct();
            var result   = function.Execute(FunctionsHelper.CreateArgs("5/5/2017", 2), this.ParsingContext);

            Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type);
        }
示例#5
0
        public void SumProductWithInvalidArgumentReturnsPoundValue()
        {
            var func   = new SumProduct();
            var args   = FunctionsHelper.CreateArgs();
            var result = func.Execute(args, this.ParsingContext);

            Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type);
        }