public async void LastName_Update_null() { Mock <IPersonRepository> personRepository = new Mock <IPersonRepository>(); personRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new Person())); var validator = new ApiPersonRequestModelValidator(personRepository.Object); await validator.ValidateUpdateAsync(default(int), new ApiPersonRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.LastName, null as string); }
public async void Suffix_Update_length() { Mock <IPersonRepository> personRepository = new Mock <IPersonRepository>(); personRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new Person())); var validator = new ApiPersonRequestModelValidator(personRepository.Object); await validator.ValidateUpdateAsync(default(int), new ApiPersonRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.Suffix, new string('A', 11)); }