Ejemplo n.º 1
0
        public void BracketChecker1_1_EmptyString()
        {
            // Arrange
            string str      = "";
            bool   expected = true;

            // Act
            bool actual = BracketChecker.CheckBrackets(str);

            // Assert
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 2
0
        public void BracketChecker1_5_TooManyClosingParentheses()
        {
            // Arrange
            string str      = "((())()))";
            bool   expected = false;

            // Act
            bool actual = BracketChecker.CheckBrackets(str);

            // Assert
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void BracketChecker1_6_NumbersOkButTooManyClosing()
        {
            // Arrange
            string str      = "(()))(";
            bool   expected = false;

            // Act
            bool actual = BracketChecker.CheckBrackets(str);

            // Assert
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 4
0
        public void BracketChecker1_3_MultipleParentheses()
        {
            // Arrange
            string str      = "((())())";
            bool   expected = true;

            // Act
            bool actual = BracketChecker.CheckBrackets(str);

            // Assert
            Assert.AreEqual(expected, actual);
        }