public async void CityId_Update_Valid_Reference() { Mock <IEventRepository> eventRepository = new Mock <IEventRepository>(); eventRepository.Setup(x => x.CityByCityId(It.IsAny <int>())).Returns(Task.FromResult <City>(new City())); var validator = new ApiEventServerRequestModelValidator(eventRepository.Object); await validator.ValidateUpdateAsync(default(int), new ApiEventServerRequestModel()); validator.ShouldNotHaveValidationErrorFor(x => x.CityId, 1); }
public async void EventStatusId_Create_Valid_Reference() { Mock <IEventRepository> eventRepository = new Mock <IEventRepository>(); eventRepository.Setup(x => x.EventStatusByEventStatusId(It.IsAny <int>())).Returns(Task.FromResult <EventStatus>(new EventStatus())); var validator = new ApiEventServerRequestModelValidator(eventRepository.Object); await validator.ValidateCreateAsync(new ApiEventServerRequestModel()); validator.ShouldNotHaveValidationErrorFor(x => x.EventStatusId, 1); }