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);
        }
예제 #2
0
        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);
        }