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); }
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); }
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); }