Exemplo n.º 1
0
        public void RoundDownWithBooleanSecondInputReturnsCorrectValue()
        {
            var function     = new Rounddown();
            var booleanTrue  = function.Execute(FunctionsHelper.CreateArgs(12.345, true), this.ParsingContext);
            var booleanFalse = function.Execute(FunctionsHelper.CreateArgs(12.345, false), this.ParsingContext);

            Assert.AreEqual(12.3d, booleanTrue.Result);
            Assert.AreEqual(12d, booleanFalse.Result);
        }
Exemplo n.º 2
0
        public void RoundDownWithNegativeSecondInputReturnsCorrectValue()
        {
            var function = new Rounddown();
            var result   = function.Execute(FunctionsHelper.CreateArgs(9333.23, -3), this.ParsingContext);

            Assert.AreEqual(9000d, result.Result);
        }
Exemplo n.º 3
0
        public void RoundDownWithPositiveSecondInputReturnsCorrectValue()
        {
            var function = new Rounddown();
            var result   = function.Execute(FunctionsHelper.CreateArgs(12.356, 1), this.ParsingContext);

            Assert.AreEqual(12.3d, result.Result);
        }
Exemplo n.º 4
0
        public void RoundDownWithNoInputsReturnsPoundValue()
        {
            var function = new Rounddown();
            var result   = function.Execute(FunctionsHelper.CreateArgs(), this.ParsingContext);

            Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type);
        }
Exemplo n.º 5
0
        public void RoundDownWithSecondArgumentAsDateAsStringReturnsCorrectValue()
        {
            var function = new Rounddown();
            var result   = function.Execute(FunctionsHelper.CreateArgs(52.3, "5/5/2017"), this.ParsingContext);

            Assert.AreEqual(52.3d, result.Result);
        }
Exemplo n.º 6
0
        public void RoundDownWithNegativeDoublePositiveSecondArgReturnsCorrectValue()
        {
            var function = new Rounddown();
            var result   = function.Execute(FunctionsHelper.CreateArgs(-5.326571, 3), this.ParsingContext);

            Assert.AreEqual(-5.326d, result.Result);
        }
Exemplo n.º 7
0
        public void RoundDownWithNegativeIntegerNegativeSecondArgReturnsCorrectValue()
        {
            var function = new Rounddown();
            var result   = function.Execute(FunctionsHelper.CreateArgs(-98, -2), this.ParsingContext);

            Assert.AreEqual(0d, result.Result);
        }
Exemplo n.º 8
0
        public void RoundDownWithFirstInputAsDateAsStringReturnsCorrectValue()
        {
            var function = new Rounddown();
            var result   = function.Execute(FunctionsHelper.CreateArgs("5/5/2017", 2), this.ParsingContext);

            Assert.AreEqual(42860d, result.Result);
        }
Exemplo n.º 9
0
        public void RoundDownWithGeneralStringFirstInputReturnsCorrectValue()
        {
            var function = new Rounddown();
            var result   = function.Execute(FunctionsHelper.CreateArgs("string", 3), this.ParsingContext);

            Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type);
        }
Exemplo n.º 10
0
        public void RoundDownWithNumericStringFirstInputReturnsCorrectValue()
        {
            var function = new Rounddown();
            var result   = function.Execute(FunctionsHelper.CreateArgs("45546.546444", 3), this.ParsingContext);

            Assert.AreEqual(45546.546d, result.Result);
        }
Exemplo n.º 11
0
        public void RoundDownWithZeroSecondInputReturnsCorrectValue()
        {
            var function = new Rounddown();
            var result   = function.Execute(FunctionsHelper.CreateArgs(58.999999, 0), this.ParsingContext);

            Assert.AreEqual(58d, result.Result);
        }
Exemplo n.º 12
0
        public void RoundDownWithNumericStringSecondArgumentReturnsCorrectValue()
        {
            var function = new Rounddown();
            var result   = function.Execute(FunctionsHelper.CreateArgs(15.351, "2"), this.ParsingContext);

            Assert.AreEqual(15.35, result.Result);
        }
Exemplo n.º 13
0
        public void RounddownShouldHandleZeroNumDigits()
        {
            var func   = new Rounddown();
            var args   = FunctionsHelper.CreateArgs(999.999, 0);
            var result = func.Execute(args, this.ParsingContext);

            Assert.AreEqual(999d, result.Result);
        }
Exemplo n.º 14
0
        public void RounddownShouldReturn0IfNegativeNumDigitsIsTooLarge()
        {
            var func   = new Rounddown();
            var args   = FunctionsHelper.CreateArgs(999.999, -4);
            var result = func.Execute(args, this.ParsingContext);

            Assert.AreEqual(0d, result.Result);
        }
Exemplo n.º 15
0
        public void RounddownShouldHandleNegativeNumber()
        {
            var func   = new Rounddown();
            var args   = FunctionsHelper.CreateArgs(-9.999, 2);
            var result = func.Execute(args, this.ParsingContext);

            Assert.AreEqual(-9.99, result.Result);
        }
Exemplo n.º 16
0
        public void RounddownShouldReturnCorrectResultWithPositiveNumber()
        {
            var func   = new Rounddown();
            var args   = FunctionsHelper.CreateArgs(9.999, 2);
            var result = func.Execute(args, this.ParsingContext);

            Assert.AreEqual(9.99, result.Result);
        }
Exemplo n.º 17
0
        public void RounddownShouldHandleNegativeNumDigits()
        {
            var func   = new Rounddown();
            var args   = FunctionsHelper.CreateArgs(999.999, -2);
            var result = func.Execute(args, _parsingContext);

            Assert.AreEqual(900d, result.Result);
        }