Пример #1
0
        public void Should_have_error_when_email_is_null_or_empty()
        {
            var model = new LoginModel();

            model.Email = null;
            _validator.ShouldHaveValidationErrorFor(x => x.Email, model);
            model.Email = "";
            _validator.ShouldHaveValidationErrorFor(x => x.Email, model);
        }
Пример #2
0
        public void ShouldHaveErrorWhenEmailIsNullOrEmpty()
        {
            var model = new LoginModel
            {
                Email = null
            };

            _validator.ShouldHaveValidationErrorFor(x => x.Email, model);
            model.Email = string.Empty;
            _validator.ShouldHaveValidationErrorFor(x => x.Email, model);
        }