public async void Name_Update_length() { Mock <IEventStatusRepository> eventStatusRepository = new Mock <IEventStatusRepository>(); eventStatusRepository.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(new EventStatus())); var validator = new ApiEventStatusRequestModelValidator(eventStatusRepository.Object); await validator.ValidateUpdateAsync(default(int), new ApiEventStatusRequestModel()); validator.ShouldHaveValidationErrorFor(x => x.Name, new string('A', 129)); }