Exemple #1
0
        public async Task RecordGatewayRemovedOutcome(Guid applicationId, string userId, string userName)
        {
            _logger.LogInformation($"Recording an oversight gateway removed outcome for application {applicationId}");

            var command = new RecordOversightGatewayRemovedOutcomeCommand
            {
                ApplicationId = applicationId,
                UserId        = userId,
                UserName      = userName
            };

            await _applicationApiClient.RecordGatewayRemovedOutcome(command);
        }
        public async Task Handle_User_Is_Notified_Of_Update_To_Application()
        {
            var request = new RecordOversightGatewayRemovedOutcomeCommand
            {
                ApplicationId = _applicationId,
                UserId        = "test user id",
                UserName      = "******"
            };

            await _handler.Handle(request, new CancellationToken());

            _applicationUpdatedEmailService.Verify(x => x.SendEmail(_applicationId), Times.Once);
        }
        public async Task Record_oversight_gateway_removed_outcome_updates_oversight_status_and_determined_date()
        {
            var command = new RecordOversightGatewayRemovedOutcomeCommand
            {
                ApplicationId = Guid.NewGuid(),
                UserId        = "User Id",
                UserName      = "******"
            };

            _mediator.Setup(x => x.Send(command, It.IsAny <CancellationToken>())).ReturnsAsync(Unit.Value);

            var result = await _controller.RecordOversightGatewayRemovedOutcome(command);

            result.Should().BeOfType <OkResult>();
        }
        public async Task Handle_Oversight_Outcome_Insert_Is_Audited()
        {
            var request = new RecordOversightGatewayRemovedOutcomeCommand
            {
                ApplicationId = _applicationId,
                UserId        = "test user id",
                UserName      = "******"
            };

            await _handler.Handle(request, new CancellationToken());

            _auditService.Verify(x => x.AuditInsert(It.Is <OversightReview>(r =>
                                                                            r.ApplicationId == request.ApplicationId &&
                                                                            r.Status == OversightReviewStatus.Removed &&
                                                                            r.UserId == request.UserId &&
                                                                            r.UserName == request.UserName)));
        }
        public async Task <ActionResult> RecordOversightGatewayRemovedOutcome([FromBody] RecordOversightGatewayRemovedOutcomeCommand command)
        {
            await _mediator.Send(command);

            return(new OkResult());
        }
 public async Task RecordGatewayRemovedOutcome(RecordOversightGatewayRemovedOutcomeCommand command)
 {
     await Post("Oversight/GatewayRemovedOutcome", command);
 }