示例#1
0
        public void Common_Test()
        {
            // Arrange
            var solution = new ValidParenthesesSolution();

            //act
            var result = solution.IsValid("[](){}");

            //Assert
            Assert.True(result);
        }
示例#2
0
        public void Nested_Brackets_Should_Return_True()
        {
            // Arrange
            var solution = new ValidParenthesesSolution();

            //act
            var result = solution.IsValid("{()}");

            //Assert
            Assert.True(result);
        }
示例#3
0
        public void Invalid_Open_Close_Brackets_Should_Return_False()
        {
            // Arrange
            var solution = new ValidParenthesesSolution();

            //act
            var result = solution.IsValid("{(})");

            //Assert
            Assert.False(result);
        }
示例#4
0
        public void One_Closed_Bracket_Should_Return_False()
        {
            // Arrange
            var solution = new ValidParenthesesSolution();

            //act
            var result = solution.IsValid("]");

            //Assert
            Assert.False(result);
        }
示例#5
0
        public void One_Symbol_Should_Return_False()
        {
            // Arrange
            var solution = new ValidParenthesesSolution();

            //act
            var result = solution.IsValid("{");

            //Assert
            Assert.False(result);
        }
示例#6
0
        public void Empty_String_Should_Return_True()
        {
            // Arrange
            var solution = new ValidParenthesesSolution();

            //act
            var result = solution.IsValid("");

            //Assert
            Assert.True(result);
        }