Ejemplo n.º 1
0
        public void IntegralForValidParametersTest_ShouldReturnCorrectValues(
            Func <Func <double, double>, double, double, double, double> func,
            Func <double, double> function,
            string method, string expression,
            double a, double b, uint n)
        {
            SetupForIntegral(method, expression, a, b, n);

            _numericalCalculationsViewMock.Raise(m => m.ComputeClicked += null, new EventArgs());

            _numericalCalculationsViewMock.Verify(
                m => m.AddResult(
                    It.Is <string>(s => s == expression),
                    It.Is <string>(s => s == Strings.Integral),
                    It.Is <string>(s => s == method),
                    It.IsAny <string>(),
                    It.Is <string>(s => s == ScriptingExtensions.ToMathString(func(function, a, b, n)))),
                Times.Once);
        }
Ejemplo n.º 2
0
        public void DerrivativeForValidParametersTest_ShouldReturnCorrectValues(
            Func <Func <double, double>, double, uint, double, double> func,
            Func <double, double> function,
            string method, string expression, double x, uint order, double eps)
        {
            SetupForDerrivative(method, expression, eps, x, order);

            _numericalCalculationsViewMock.Raise(m => m.ComputeClicked += null, new EventArgs());

            _numericalCalculationsViewMock.Verify(
                m =>
                m.AddResult(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(),
                            It.IsAny <string>()), Times.Once);

            _numericalCalculationsViewMock.Verify(
                m => m.AddResult(
                    It.Is <string>(s => s == expression),
                    It.Is <string>(s => s == Strings.Derivative),
                    It.Is <string>(s => s == method),
                    It.IsAny <string>(),
                    It.Is <string>(s => s == ScriptingExtensions.ToMathString(func(function, x, order, eps)))),
                Times.Once);
        }