Пример #1
0
        public async Task <AddResidentAuditResponse> CreateResidentAudit(CreateResidentAuditRequest residentAuditRequest)
        {
            var token = await _crmTokenGateway.GetCRMToken();

            var residentAuditResponse = await _crmGateway.GenerateResidentAuditRecord(AuditFactory.ToResidentAuditRequest(residentAuditRequest), token);

            var addResidentAuditResponse = new AddResidentAuditResponse
            {
                success = residentAuditResponse
            };

            return(addResidentAuditResponse);
        }
Пример #2
0
        public async Task EnsureControllerPostMethodCallsPostAuditUseCaseForResidentAudit()
        {
            var response = new AddResidentAuditResponse
            {
                success = true
            };
            var request = new CreateResidentAuditRequest
            {
            };

            _mockPostAuditUseCase.Setup(x => x.CreateResidentAudit(request)).ReturnsAsync(response);
            var result = await _classUnderTest.GenerateResidentAuditLog(request).ConfigureAwait(true);

            _mockPostAuditUseCase.Verify(x => x.CreateResidentAudit(It.IsAny <CreateResidentAuditRequest>()), Times.Once);
        }
Пример #3
0
        public async Task ControllerPostMethodShouldReturn204StatusCodeForResidentAudit()
        {
            var response = new AddResidentAuditResponse
            {
                success = true
            };
            var request = new CreateResidentAuditRequest
            {
            };

            _mockPostAuditUseCase.Setup(x => x.CreateResidentAudit(request)).ReturnsAsync(response);
            var result = await _classUnderTest.GenerateResidentAuditLog(request).ConfigureAwait(true) as NoContentResult;

            result.Should().NotBeNull();
            result.StatusCode.Should().Be(204);
        }