public void CanMapInputToGenerateResidentAuditRequestObject() { var auditRequest = TestHelpers.CreateResidentAuditRequestObject(_faker, true); var factoryResponse = AuditFactory.ToResidentAuditRequest(auditRequest); factoryResponse.hackney_accountnumber.Should().Be(auditRequest.RentAccountNumber); factoryResponse.hackney_postcode.Should().Be(auditRequest.PostCode); }
public void CanMapInputToGenerateResidentAuditRequestObjectForAnonUser() { var auditRequest = TestHelpers.CreateResidentAuditRequestObject(_faker, false); var factoryResponse = AuditFactory.ToResidentAuditRequest(auditRequest); factoryResponse.hackney_accountnumber.Should().Be(auditRequest.RentAccountNumber); factoryResponse.hackney_postcode.Should().Be(auditRequest.PostCode); factoryResponse.hackney_name.Should().Equals("Anonymous Rent Account Audit History"); }
public async Task UseCaseShouldCallGatewayToInsertResidentAuditData() { var token = "12345"; var auditRequest = TestHelpers.CreateResidentAuditRequestObject(_faker, true); _mockCrmTokenGateway.Setup(x => x.GetCRMToken()).ReturnsAsync(token); _mockCrmGateway.Setup(x => x.GenerateResidentAuditRecord(AuditFactory.ToResidentAuditRequest(auditRequest), token)).ReturnsAsync(true); await _classUnderTest.CreateResidentAudit(auditRequest).ConfigureAwait(true); _mockCrmGateway.Verify(x => x.GenerateResidentAuditRecord(It.IsAny <MyRentAccountResidentAudit>(), token), Times.Once); }
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); }