public void ShouldNotHaveErrorWhenLocationMatched() { var viewModel = new ApprenticeshipSearchViewModel { Location = "Test", Latitude = 0.1d, Longitude = 1.0d }; var viewModelClientValidator = new ApprenticeshipSearchViewModelClientValidator(); viewModelClientValidator.ShouldNotHaveValidationErrorFor(x => x.Location, viewModel); }
public void ShouldHaveErrorWhenLocationIsUnder2Characters() { var viewModel = new ApprenticeshipSearchViewModel { Location = "x", Latitude = 0.1d, Longitude = 1.0d }; var viewModelClientValidator = new ApprenticeshipSearchViewModelClientValidator(); viewModelClientValidator.ShouldHaveValidationErrorFor(x => x.Location, viewModel); }
public void ValidateShouldReturnTrueWhenMatch() { var viewModel = new ApprenticeshipSearchViewModel { Location = "Test", Latitude = 0.1d, Longitude = 1.0d }; var viewModelClientValidator = new ApprenticeshipSearchViewModelClientValidator(); var test = viewModelClientValidator.Validate(viewModel); test.IsValid.Should().BeTrue(); }