コード例 #1
0
        public void validatestringOfIncorrectLength()
        {
            _validatorService = new ValidatorService();

            // strings with valid data and over the max length are invalid
            foreach (string test in STRING_VALID_LIST)
            {
                Assert.False(_validatorService.validateString(test, test.Length - 1, false));
            }
        }
コード例 #2
0
        public void validatestringEmptyAndRequired()
        {
            _validatorService = new ValidatorService();

            // strings with null or empty values and are required are invalid
            foreach (string test in STRING_EMPTY_LIST)
            {
                Assert.False(_validatorService.validateString(test, 1, true));
            }
        }
コード例 #3
0
        public void validatestringOfCorrectLength()
        {
            _validatorService = new ValidatorService();

            // strings with valid data and under max length are valid
            foreach (string test in STRING_VALID_LIST)
            {
                Assert.True(_validatorService.validateString(test, test.Length, false));
            }
        }