public void WhenTheMediatorReturnsAOrganizationDetailModelForThatIdAViewShouldBeReturned() { CreateSut(); var model = new OrganizationDetailModel(); _mediator.Setup(x => x.Send(It.Is<OrganizationDetailQuery>(y => y.Id == Id))).Returns(model); var result = (ViewResult)_sut.Details(Id); Assert.Same(model, result.ViewData.Model); }
public void DeleteGetWhenMediatorReturnsAnOrganizationAViewOfThatOrganizationShouldBeShown() { CreateSut(); var organizationModel = new OrganizationDetailModel(); _mediator.Setup(x => x.Send(It.Is<OrganizationDetailQuery>(y => y.Id == Id))).Returns(organizationModel); var result = (ViewResult)_sut.Delete(Id); Assert.Same(organizationModel, result.ViewData.Model); }
public async Task DetailsShouldReturnTheCorrectViewAndViewModelWhenOrganizationIsNotNull() { CreateSut(); var model = new OrganizationDetailModel(); _mediator.Setup(x => x.SendAsync(It.Is<OrganizationDetailQueryAsync>(y => y.Id == Id))).ReturnsAsync(model); var result = (ViewResult) await _sut.Details(Id); Assert.IsType<ViewResult>(result); Assert.Same(model, result.ViewData.Model); }