Пример #1
0
        public void BracketChecker2_1_EmptyString()
        {
            // Arrange
            string str      = "";
            bool   expected = true;

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

            // Assert
            Assert.AreEqual(expected, actual);
        }
Пример #2
0
        public void BracketChecker2_7_Combined4()
        {
            // Arrange
            string str      = "[[[{{(}}]]])";
            bool   expected = false;

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

            // Assert
            Assert.AreEqual(expected, actual);
        }
Пример #3
0
        public void BracketChecker2_6_Combined3()
        {
            // Arrange
            string str      = "[{(([))]}]";
            bool   expected = false;

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

            // Assert
            Assert.AreEqual(expected, actual);
        }
Пример #4
0
        public void BracketChecker2_5_Combined2()
        {
            // Arrange
            string str      = "[(({[]}))]";
            bool   expected = true;

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

            // Assert
            Assert.AreEqual(expected, actual);
        }
Пример #5
0
        public void BracketChecker2_2_Curly()
        {
            // Arrange
            string str      = "{{}}";
            bool   expected = true;

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

            // Assert
            Assert.AreEqual(expected, actual);
        }
        static void Opgave4()
        {
            System.Console.WriteLine("\n=====   Opgave 4 : BracketChecker   =====\n");

            System.Console.WriteLine(BracketChecker.CheckBrackets(""));
            System.Console.WriteLine(BracketChecker.CheckBrackets("()"));
            System.Console.WriteLine(BracketChecker.CheckBrackets("())"));

            System.Console.WriteLine("\n=====   Opgave 4 : BracketChecker2   =====\n");

            System.Console.WriteLine(BracketChecker.CheckBrackets2("(())([][][][[]]{})"));
            System.Console.WriteLine(BracketChecker.CheckBrackets2("(){}[]["));
            System.Console.WriteLine(BracketChecker.CheckBrackets2("([)]"));
            System.Console.WriteLine(BracketChecker.CheckBrackets2("([][]"));
        }