Created
January 11, 2011 16:02
-
-
Save underwhelmed/774620 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test] | |
public void FailWhenTheFirstNameIsTooLong() | |
{ | |
var svc = new UserImportValidationService(_userRepo, _divRepo, _jcRepo, _locRepo); | |
var user = new UserRecord(); | |
user.UserLoginID = "VALID"; | |
user.FirstName = "This is really long and shouldn't be imported because we said that the first name and last name fields should only be less than 50 characters. It's pretty arbitrary, but that's what the database can hold so that's why we're doing it that way. Groundhog Day was a sweet movie."; | |
Validation val = svc.IsValid(user); | |
Assert.IsFalse(val.IsValid); | |
Assert.IsTrue(val.ErrorMessages.Any(w => w.Contains("FirstName is too long"))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment