Exemplo n.º 1
0
 public static void TestIsBalanced()
 {
     Assert.IsTrue(StackExtra.IsBalances("(()((())()))"));
     Assert.IsFalse(StackExtra.IsBalances("(()()(()"));
     Assert.IsFalse(StackExtra.IsBalances("())("));
     Assert.IsFalse(StackExtra.IsBalances("))(("));
     Assert.IsFalse(StackExtra.IsBalances("((())"));
 }
Exemplo n.º 2
0
        public static void TestBonusPolishNotation()
        {
            Assert.AreEqual(59, StackExtra.CalculatePolishNotation("8 2 + 5 * 9 + ="));

            Assert.AreEqual(9, StackExtra.CalculatePolishNotation("1 2 + 3 * ="));
        }