示例#1
0
        public void AddTermsOfPowerTest2()
        {
            Polynomial p = new Polynomial("7x+x=0");

            Term result = p.AddTermsOfPower(EquationSide.Left, 'x', 1);

            Assert.AreEqual(8, result.Coef);
            Assert.AreEqual('x', result.VariableSymbol);
            Assert.AreEqual(1, result.Power);
        }
示例#2
0
        public void AddTermsOfPowerTest3()
        {
            Polynomial p = new Polynomial("25+20=0");

            Term result = p.AddTermsOfPower(EquationSide.Left, Term.DefaultVariableSymbol, 0);

            Assert.AreEqual(45, result.Coef);
            Assert.AreEqual(Term.DefaultVariableSymbol, result.VariableSymbol);
            Assert.AreEqual(0, result.Power);
        }
示例#3
0
        public void AddTermsOfPowerTest()
        {
            Polynomial p = new Polynomial("2x^2+2x^2=0");

            Term result = p.AddTermsOfPower(EquationSide.Left, 'x', 2);

            Assert.AreEqual(4, result.Coef);
            Assert.AreEqual('x', result.VariableSymbol);
            Assert.AreEqual(2, result.Power);
        }