Example #1
0
        public void StdevSIsGivenAMixedStringInputWithAEmptyCellInTheMiddle()
        {
            var function = new StdevS();
            var result1  = function.Execute(FunctionsHelper.CreateArgs(10, 2, "6/17/2011 2:00", "02:00 am"), this.ParsingContext);
            var result2  = function.Execute(FunctionsHelper.CreateArgs(10, 2, "6/17/2011 2:00", null, "02:00 am"), this.ParsingContext);

            Assert.AreEqual(20353.52823, result1.ResultNumeric, .00001);
            Assert.AreEqual(18205.19946, result2.ResultNumeric, .00001);
        }
Example #2
0
        public void StdevSIsGivenStringNumbersAsInputs()
        {
            var function = new StdevS();
            var result1  = function.Execute(FunctionsHelper.CreateArgs("5", "6", "7"), this.ParsingContext);
            var result2  = function.Execute(FunctionsHelper.CreateArgs("5.5", "6.6", "7.7"), this.ParsingContext);

            Assert.AreEqual(1, result1.ResultNumeric, .00001);
            Assert.AreEqual(1.1, result2.ResultNumeric, .00001);
        }
Example #3
0
        public void StdevSIsGivenAStringInputWithAEmptyCellInTheMiddle()
        {
            var function = new StdevS();
            var result1  = function.Execute(FunctionsHelper.CreateArgs(66, 52, 77, 71, 30, 90, 26, 56, 7), this.ParsingContext);
            var result2  = function.Execute(FunctionsHelper.CreateArgs(66, 52, 77, 71, null, 30, 90, 26, 56, 7), this.ParsingContext);

            Assert.AreEqual(26.97581221, result1.ResultNumeric, .00001);
            Assert.AreEqual(30.42020527, result2.ResultNumeric, .00001);
        }
Example #4
0
        public void StdevSIsGivenAMixOfInputTypes()
        {
            var function = new StdevS();
            var result1  = function.Execute(FunctionsHelper.CreateArgs(1, true, null, "6/17/2011 2:00", "02:00 am"), this.ParsingContext);
            var result2  = function.Execute(FunctionsHelper.CreateArgs(1, true, "6/17/2011 2:00", "02:00 am"), this.ParsingContext);

            Assert.AreEqual(18206.31704, result1.ResultNumeric, .00001);
            Assert.AreEqual(20355.19445, result2.ResultNumeric, .00001);
        }
Example #5
0
        public void StdevSIsGivenBooleanInputs()
        {
            var function       = new StdevS();
            var boolInputTrue  = true;
            var boolInputFalse = false;
            var result1        = function.Execute(FunctionsHelper.CreateArgs(boolInputTrue, boolInputTrue, boolInputFalse), this.ParsingContext);
            var result2        = function.Execute(FunctionsHelper.CreateArgs(boolInputTrue, boolInputTrue, boolInputTrue), this.ParsingContext);
            var result3        = function.Execute(FunctionsHelper.CreateArgs(boolInputTrue, boolInputFalse, boolInputFalse), this.ParsingContext);

            Assert.AreEqual(0.577350269, result1.ResultNumeric, .00001);
            Assert.AreEqual(0, result2.ResultNumeric, .00001);
            Assert.AreEqual(0.577350269, result3.ResultNumeric, .00001);
        }
Example #6
0
        public void StdevSIsGivenADateSeperatedByABackslash()
        {
            var function = new StdevS();
            var input1   = "1/17/2011 2:00";
            var input2   = "6/17/2011 2:00";
            var input3   = "1/17/2012 2:00";
            var input4   = "1/17/2013 2:00";
            var result1  = function.Execute(FunctionsHelper.CreateArgs(input1, input1, input1), this.ParsingContext);
            var result2  = function.Execute(FunctionsHelper.CreateArgs(input1, input2, input1), this.ParsingContext);
            var result3  = function.Execute(FunctionsHelper.CreateArgs(input1, input3, input4), this.ParsingContext);

            Assert.AreEqual(0, result1.ResultNumeric, .00001);
            Assert.AreEqual(87.17989065, result2.ResultNumeric, .00001);
            Assert.AreEqual(365.500114, result3.ResultNumeric, .00001);
        }
Example #7
0
        public void StdevSIsGivenASingleStringInput()
        {
            var function = new StdevS();
            var result1  = function.Execute(FunctionsHelper.CreateArgs("string"), this.ParsingContext);

            Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result1.Result).Type);
        }
Example #8
0
        public void StdevSIsGivenASingleFalseBooleanInput()
        {
            var function = new StdevS();
            var result1  = function.Execute(FunctionsHelper.CreateArgs(false), this.ParsingContext);

            Assert.AreEqual(0, result1.ResultNumeric, .00001);;
        }
Example #9
0
        public void StdevSIsGivenDateTimeInputsSeperatedByADashAsInputs()
        {
            var function = new StdevS();
            var result1  = function.Execute(FunctionsHelper.CreateArgs("1-17-2017 2:00", "6-17-2017 2:00", "9-17-2017 2:00"), this.ParsingContext);

            Assert.AreEqual(122.6879511, result1.ResultNumeric, .00001);
        }
Example #10
0
        public void StdevSIsGivenMonthDayYear12HourTimeAsInputs()
        {
            var function = new StdevS();
            var result1  = function.Execute(FunctionsHelper.CreateArgs("Jan 17, 2011 2:00 am", "June 5, 2017 11:00 pm", "June 15, 2017 11:00 pm"), this.ParsingContext);

            Assert.AreEqual(1349.204675, result1.ResultNumeric, .00001);
        }
Example #11
0
        public void StdevSIsGiven12HourTimesAsInputs()
        {
            var function = new StdevS();
            var result1  = function.Execute(FunctionsHelper.CreateArgs("12:00 am", "02:00 am", "01:00 pm"), this.ParsingContext);

            Assert.AreEqual(0.291666667, result1.ResultNumeric, .00001);
        }
Example #12
0
        public void StdevSIsGivenNumbersAsInputstakeTwo()
        {
            var function = new StdevS();
            var result1  = function.Execute(FunctionsHelper.CreateArgs(-1, -1, -1), this.ParsingContext);

            Assert.AreEqual(0, result1.ResultNumeric, .00001);
        }
Example #13
0
        public void StdevSIsGivenMaxAmountOfInputs254()
        {
            var function = new StdevS();
            var input1   = 1;

            var result1 = function.Execute(FunctionsHelper.CreateArgs(
                                               100, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1,
                                               input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1,
                                               input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1,
                                               input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1,
                                               input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1,
                                               input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1,
                                               input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1,
                                               input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1,
                                               input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1,
                                               input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1,
                                               input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1,
                                               input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1,
                                               input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1,
                                               input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1,
                                               input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1,
                                               input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1,
                                               input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1, input1
                                               ), this.ParsingContext);

            Assert.AreEqual(6.211812471, result1.ResultNumeric, .00001);
        }