示例#1
0
        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();
        }
示例#2
0
        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();
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }