public async Task ShouldReturnNotFound() { var result = (await _solutionsController.AuthorityDashboard(SolutionId).ConfigureAwait(false)).Result as ObjectResult; result.StatusCode.Should().Be((int)HttpStatusCode.OK); (result.Value as SolutionAuthorityDashboardResult).Id.Should().BeNull(); }
public async Task ShouldReturnNotFound() { var result = (await solutionsController.AuthorityDashboard(SolutionId)).Result as ObjectResult; Assert.NotNull(result); result.StatusCode.Should().Be(StatusCodes.Status200OK); result.Value.Should().BeOfType <SolutionAuthorityDashboardResult>(); result.Value.As <SolutionAuthorityDashboardResult>().Id.Should().BeNull(); }
private async Task <SolutionAuthorityDashboardResult> GetSolutionAuthorityDashboardSectionAsync( ISolution solution) { mockMediator .Setup(m => m.Send( It.Is <GetSolutionByIdQuery>(q => q.Id == SolutionId), It.IsAny <CancellationToken>())) .ReturnsAsync(solution); var result = (await solutionsController.AuthorityDashboard(SolutionId)).Result as ObjectResult; Assert.NotNull(result); result.StatusCode.Should().Be(StatusCodes.Status200OK); mockMediator.Verify( m => m.Send(It.Is <GetSolutionByIdQuery>(q => q.Id == SolutionId), It.IsAny <CancellationToken>())); return(result.Value as SolutionAuthorityDashboardResult); }
private async Task <SolutionAuthorityDashboardResult> GetSolutionAuthorityDashboardSectionAsync( ISolution solution) { _mockMediator.Setup(m => m.Send(It.Is <GetSolutionByIdQuery>(q => q.Id == SolutionId), It.IsAny <CancellationToken>())) .ReturnsAsync(solution); var result = (await _solutionsController.AuthorityDashboard(SolutionId).ConfigureAwait(false)) .Result as ObjectResult; result.Should().NotBeNull(); result.StatusCode.Should().Be((int)HttpStatusCode.OK); _mockMediator.Verify( m => m.Send(It.Is <GetSolutionByIdQuery>(q => q.Id == SolutionId), It.IsAny <CancellationToken>()), Times.Once); return(result.Value as SolutionAuthorityDashboardResult); }