Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #4
0
        public void OneNumberTest()
        {
            var exp    = new Stdev(new[] { new Number(4) }, 1);
            var result = (double)exp.Execute();

            Assert.Equal(double.NaN, result);
        }
Пример #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);
        }
Пример #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);
        }
Пример #7
0
        public void OneNumberTest()
        {
            var exp = new Stdev(new[] { new Number(4) }, 1);
            var result = (double)exp.Execute();

            Assert.Equal(double.NaN, result);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }