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); }
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); }