public void IsValid_WhenUserName_IsEmpty(string userName) { var command = new FakeMustNotContainInvalidUserNameTextCommand { UserName = userName, }; var validator = new FakeMustNotContainInvalidUserNameTextValidator(); var result = validator.Validate(command); result.IsValid.ShouldBeTrue(); validator.ShouldNotHaveValidationErrorFor(x => x.UserName, command.UserName); }
public void IsValid_WhenUserName_IsEmailAddress() { var userName = string.Format("{0}@domain.tld", Guid.NewGuid()); var command = new FakeMustNotContainInvalidUserNameTextCommand { UserName = userName, }; var validator = new FakeMustNotContainInvalidUserNameTextValidator(); var result = validator.Validate(command); result.IsValid.ShouldBeTrue(); validator.ShouldNotHaveValidationErrorFor(x => x.UserName, command.UserName); }