Esempio n. 1
0
        public void VectorTest()
        {
            var exp    = new Stdev(new[] { new Vector(new[] { new Number(2), new Number(4), new Number(9) }) }, 1);
            var result = (double)exp.Execute();

            Assert.Equal(3.60555127546399, result, 14);
        }
Esempio n. 2
0
        public void TwoNumberTest()
        {
            var exp    = new Stdev(new[] { new Number(4), new Number(9) }, 2);
            var result = (double)exp.Execute();

            Assert.Equal(3.53553390593274, result, 14);
        }
Esempio n. 3
0
        public void ThreeNumberTest()
        {
            var exp    = new Stdev(new[] { new Number(9), new Number(2), new Number(4) }, 3);
            var result = (double)exp.Execute();

            Assert.Equal(3.60555127546399, result, 14);
        }
Esempio n. 4
0
        public void OneNumberTest()
        {
            var exp    = new Stdev(new[] { new Number(4) }, 1);
            var result = (double)exp.Execute();

            Assert.Equal(double.NaN, result);
        }
Esempio n. 5
0
        public void TwoNumberTest()
        {
            var exp = new Stdev(new[] { new Number(4), new Number(9) }, 2);
            var result = (double)exp.Execute();

            Assert.Equal(3.53553390593274, result, 14);
        }
Esempio n. 6
0
        public void ThreeNumberTest()
        {
            var exp = new Stdev(new[] { new Number(9), new Number(2), new Number(4) }, 3);
            var result = (double)exp.Execute();

            Assert.Equal(3.60555127546399, result, 14);
        }
Esempio n. 7
0
        public void OneNumberTest()
        {
            var exp = new Stdev(new[] { new Number(4) }, 1);
            var result = (double)exp.Execute();

            Assert.Equal(double.NaN, result);
        }
Esempio n. 8
0
        public void StdevShouldCalculateCorrectResult()
        {
            var func   = new Stdev();
            var args   = FunctionsHelper.CreateArgs(1, 3, 5);
            var result = func.Execute(args, _parsingContext);

            Assert.AreEqual(2d, result.Result);
        }
Esempio n. 9
0
        public void StdevShouldIgnoreHiddenValuesWhenIgnoreHiddenValuesIsSet()
        {
            var func = new Stdev();

            func.IgnoreHiddenValues = true;
            var args = FunctionsHelper.CreateArgs(1, 3, 5, 6);

            args.Last().SetExcelStateFlag(ExcelCellState.HiddenCell);
            var result = func.Execute(args, _parsingContext);

            Assert.AreEqual(2d, result.Result);
        }
Esempio n. 10
0
        public void VectorTest()
        {
            var exp = new Stdev(new[] { new Vector(new[] { new Number(2), new Number(4), new Number(9) }) }, 1);
            var result = (double)exp.Execute();

            Assert.Equal(3.60555127546399, result, 14);
        }