Beispiel #1
0
            public void Validate_GivenAllPropertiesAreValid_ExpectValidationSuccess()
            {
                var model = new RequestAccountVerification.Model {
                    EmailAddress = "*****@*****.**"
                };
                var validator = new RequestAccountVerification.Validator();
                var result    = validator.Validate(model);

                Assert.True(result.IsValid);
            }
Beispiel #2
0
            public void Validate_GivenEmailAddressIsNull_ExpectValidationFailure()
            {
                var model = new RequestAccountVerification.Model {
                    EmailAddress = null
                };
                var validator = new RequestAccountVerification.Validator();
                var result    = validator.Validate(model);

                Assert.False(result.IsValid);
                Assert.Contains(result.Errors, x => x.PropertyName == "EmailAddress");
            }