-
a) these emails worked:
abc@def.ghi , ABC@def.ghi , abc@EDF.ghib) but these ones didn't:
abc@def.Ghi , abc@def.gHi , abc@def.GHI
Basically, if the TLD (top level domain) part of the email address was in caps, the data validation failed, and the new user creation did not complete.
The problem was the email validation regex used:
public class ValidationRegexwhich was changed to (diff in bold)
{
public const string Email = @"^[\w-+\.]{1,}\@([\w-]{1,}\.){1,}[a-z]{2,4}$";
}
public const string Email = @"^[\w-+\.]{1,}\@([\w-]{1,}\.){1,}[a-zA-Z]{2,4}$";After this fix, the Unit Test I was working on passed with no errors:
For reference, here is what the Data Contract (for new user creation) looks like:
Also interesting is the history of the regex I'm currently using: The Email RegEx that (could had) DOSed a site
NCrunch in action
If you noticed those green dots on the test source code, they are from NCrunch VisualStudio plugin which is really making a massive difference in my .NET development speed, quality and enjoyment.
For example, if I change back the RegEx to the original value:
... NCrunch will pick up the fact that the code changed, and in a couple secs, this test fails:
Here are a couple posts I've written about NCrunch:
- Trying out NCrunch
- Changing the way User Sessions are handled by TeamMentor (will be 3.3 Release HotFix 3)