public async Task EditPostCallsValidateOnTaskSummaryModelValidator() { var mediator = new Mock<IMediator>(); mediator.Setup(x => x.Send(It.IsAny<EventByIdQuery>())).Returns(new Event { Campaign = new Campaign { TimeZoneId = "Eastern Standard Time" } }); var validator = new Mock<ITaskSummaryModelValidator>(); validator.Setup(x => x.Validate(It.IsAny<TaskSummaryModel>())).Returns(new List<KeyValuePair<string, string>>()); var sut = new TaskController(mediator.Object, validator.Object); sut.SetFakeUserType(UserType.OrgAdmin); await sut.Edit(new TaskSummaryModel { EndDateTime = DateTimeOffset.Now.AddDays(-1), StartDateTime = DateTimeOffset.Now.AddDays(1), OrganizationId = 1 }); validator.Verify(x => x.Validate(It.IsAny<TaskSummaryModel>()), Times.Once); }