public void Balanced_TEST(string input, bool expected)
        {
            BalancedBrackets bb     = new BalancedBrackets();
            bool             result = bb.Balanced(input);

            Assert.Equal(result, expected);
        }
Пример #2
0
        public void Balanced_Should_Return_False_For_Example_4()
        {
            //Arrange
            var sut = new BalancedBrackets();

            //Act
            var result = sut.Balanced(Example_4_Balanced);

            //Assert
            Assert.IsTrue(result);
        }
Пример #3
0
        public void Balanced_Should_Return_True_For_Empty_String()
        {
            //Arrange
            var sut = new BalancedBrackets();

            //Act
            var result = sut.Balanced(string.Empty);

            //Assert
            Assert.IsTrue(result);
        }
Пример #4
0
        private static void RunBrackets()
        {
            Console.Write("Enter input string: ");
            var input = Console.ReadLine();

            var bb       = new BalancedBrackets();
            var balanced = bb.Balanced(input);

            Console.WriteLine($"\nBalanced: {balanced}\n");

            Options();
        }