public void ShouldNotHaveErrorsOnSendWhenFilled() { const string aString = "SomeString"; const string anEmail = "*****@*****.**"; var viewModel = new ContactMessageViewModel { Name = aString, Email = anEmail, Enquiry = aString }; var viewModelValidator = new ContactMessageClientViewModelValidator(); viewModelValidator.ShouldNotHaveValidationErrorFor(x => x.Details, viewModel); viewModelValidator.ShouldNotHaveValidationErrorFor(x => x.Name, viewModel); viewModelValidator.ShouldNotHaveValidationErrorFor(x => x.Enquiry, viewModel); viewModelValidator.ShouldNotHaveValidationErrorFor(x => x.Email, viewModel); }
public void ShouldHaveErrorsOnSendWhenBlank() { var viewModel = new ContactMessageViewModel(); var viewModelValidator = new ContactMessageClientViewModelValidator(); viewModelValidator.ShouldNotHaveValidationErrorFor(x => x.Details, viewModel); viewModelValidator.ShouldHaveValidationErrorFor(x => x.Name, viewModel); viewModelValidator.ShouldHaveValidationErrorFor(x => x.Enquiry, viewModel); viewModelValidator.ShouldHaveValidationErrorFor(x => x.Email, viewModel); }