public async Task DeleteGetWhenMediatorReturnsAnOrganizationAViewOfThatOrganizationShouldBeShown() { CreateSut(); var organizationModel = new OrganizationDetailViewModel(); _mediator.Setup(x => x.SendAsync(It.Is<OrganizationDetailQueryAsync>(y => y.Id == Id))).ReturnsAsync(organizationModel); var result = (ViewResult) await _sut.Delete(Id); Assert.Same(organizationModel, result.ViewData.Model); }
public async Task DetailsShouldReturnTheCorrectViewAndViewModelWhenOrganizationIsNotNull() { CreateSut(); var model = new OrganizationDetailViewModel(); _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); }