public void Derivative_CosMinusSin_CorrectResultReturned()
        {
            Function a              = new Cos();
            Function b              = new Sin();
            var      res            = a - b;
            var      expectedResult = new SubtractionOfFunctions(new UnaryMinusOfFunction(new Sin()), new Cos());

            Assert.AreEqual(expectedResult, res.Derivative());
        }
Beispiel #2
0
        public void BuiltFunction_LinearAndPolynomial_CorrectResultReturned()
        {
            const string function       = "sf l x+3 - p x^3-5";
            var          res            = new AddInStorageBuilder().BuildFunction(function);
            var          expectedResult = new SubtractionOfFunctions(new Linear(1, 3), new Polynomial(new List <double> {
                -5, 0, 0, 1
            }));

            Assert.AreEqual(expectedResult, res);
        }