示例#1
0
        public async Task NullReturnedWhenRexExPassesValidation()
        {
            var input              = "*****@*****.**";
            var emailPattern       = Constant.RegExPatterns.EmailAddress;
            var patternDescription = "email address";
            var regExValidation    = new ValidationRegEx(emailPattern, patternDescription);
            var result             = await regExValidation.ValidateAsync(input);

            Assert.AreEqual(null, result);
        }
示例#2
0
        public async Task MessageReturnedWhenNoRexExMatchFound()
        {
            var input              = "RandomNonMatchingPattern";
            var emailPattern       = Constant.RegExPatterns.EmailAddress;
            var patternDescription = "email address";
            var expectedResult     = String.Format(Constant.Messages.Violations.RegExMisMatch, patternDescription);
            var regExValidation    = new ValidationRegEx(emailPattern, patternDescription);
            var result             = await regExValidation.ValidateAsync(input);

            Assert.AreEqual(expectedResult, result);
        }