Exemplo n.º 1
0
        public void Reset()
        {
            RPN test = new RPN("x^2").Compute();

            PostFix math = new PostFix(test);

            Assert.AreEqual(4, math.SetVariable("x", 2).Compute());

            math.Reset();
            Assert.AreEqual(9, math.SetVariable("x", 3).Compute());

            math.Reset();
            Assert.AreEqual(16, math.SetVariable("x", 4).Compute());
        }