Beispiel #1
0
        public void UseCaseShouldCallGatewayToInsertAuditData()
        {
            var auditRequest = TestHelpers.CreateAuditRequestObject(_faker);

            _mockGateway.Setup(x => x.GenerateAdminAuditRecord(AuditFactory.ToAdminAuditRequest(auditRequest)));
            _classUnderTest.CreateAdminAudit(auditRequest);

            _mockGateway.Verify(x => x.GenerateAdminAuditRecord(It.IsAny <MyRentAccountAdminAudit>()), Times.Once);
        }
        public void CanMapInputToGenerateAdminAuditRequestObject()
        {
            var auditRequest = TestHelpers.CreateAuditRequestObject(_faker);

            var factoryResponse = AuditFactory.ToAdminAuditRequest(auditRequest);

            factoryResponse.User.Should().Be(auditRequest.User);
            factoryResponse.RentAccountNumber.Should().Be(auditRequest.RentAccountNumber);
            factoryResponse.AuditAction.Should().Be(auditRequest.AuditAction);
            factoryResponse.CSSOLogin.Should().Be(auditRequest.CSSOLogin.ToString());
            factoryResponse.TimeStamp.Should().NotBeNullOrEmpty();
        }
Beispiel #3
0
 public void CreateAdminAudit(CreateAdminAuditRequest auditRequest)
 {
     _gateway.GenerateAdminAuditRecord(AuditFactory.ToAdminAuditRequest(auditRequest));
 }