public void LongTest()
        {
            double result = RPNCalculator.Calculate("10 6 9 3 + -11 * / * 17 + 5 +");

            Assert.IsTrue(result > 21 && result < 22);
        }
 public void SimpleTest()
 {
     Assert.AreEqual(RPNCalculator.Calculate("2 1 + 3 *"), 9);
 }
 public void NonIntegerResultTest()
 {
     Assert.AreEqual(RPNCalculator.Calculate("4 13  5 / +"), 6.6);
 }
 public void TooManyOperatorsTest()
 {
     Assert.AreEqual(RPNCalculator.Calculate("4 5 5 + + +"), double.MinValue);
 }
 public void MultipleDigitTest()
 {
     Assert.AreEqual(RPNCalculator.Calculate("21 3 *"), 63);
 }
 public void ExtraSpacesTest()
 {
     Assert.AreEqual(RPNCalculator.Calculate("22    -22      +"), 0);
 }
Exemplo n.º 7
0
 public void TooManyOperators()
 {
     RPNCalculator.Calculate("3 3 + +");
 }
Exemplo n.º 8
0
 public void StackOverflowException()
 {
     RPNCalculator.Calculate("”1 2 3 4 5 6 7 8 9 10 11 + * + * + * + * + * + *");
 }
Exemplo n.º 9
0
 public void NotEnoughOperators()
 {
     RPNCalculator.Calculate("3 3");
 }
Exemplo n.º 10
0
 public void NoInputGivenException()
 {
     RPNCalculator.Calculate("");
 }
Exemplo n.º 11
0
        public void TestInitSize()
        {
            IRPNCalculator c = new RPNCalculator();

            Assert.True(c.Size() == 0);
        }
Exemplo n.º 12
0
 public void Init()
 {
     rpnCalculator = new RPNCalculator();
 }
Exemplo n.º 13
0
 public void CleanUp()
 {
     rpnCalculator = null;
 }