Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public void ProcessSaleTransactionRequest_CanBeCreated_IsCreated()
ProcessSaleTransactionRequest processSaleTransactionRequest = ProcessSaleTransactionRequest.Create(TestData.TransactionId, TestData.EstateId, TestData.MerchantId, TestData.DeviceIdentifier, TestData.TransactionTypeLogon.ToString(), TestData.TransactionDateTime,
TestData.TransactionNumber,
TestData.OperatorIdentifier1,
TestData.CustomerEmailAddress,
TestData.AdditionalTransactionMetaData);

processSaleTransactionRequest.ShouldNotBeNull();
Expand All @@ -44,6 +45,7 @@ public void ProcessSaleTransactionRequest_CanBeCreated_IsCreated()
processSaleTransactionRequest.TransactionNumber.ShouldBe(TestData.TransactionNumber);
processSaleTransactionRequest.TransactionId.ShouldBe(TestData.TransactionId);
processSaleTransactionRequest.OperatorIdentifier.ShouldBe(TestData.OperatorIdentifier1);
processSaleTransactionRequest.CustomerEmailAddress.ShouldBe(TestData.CustomerEmailAddress);
processSaleTransactionRequest.AdditionalTransactionMetadata.ShouldNotBeNull();
processSaleTransactionRequest.AdditionalTransactionMetadata.Count.ShouldBe(TestData.AdditionalTransactionMetaData.Count);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,5 +232,20 @@ await transactionAggregateManager.CompleteTransaction(TestData.EstateId,
TestData.TransactionId,
CancellationToken.None);
}

[Fact]
public async Task TransactionAggregateManager_RequestEmailReceipt_EmailRecieptRequested()
{
Mock<IAggregateRepository<TransactionAggregate>> aggregateRepository = new Mock<IAggregateRepository<TransactionAggregate>>();
aggregateRepository.Setup(a => a.GetLatestVersion(It.IsAny<Guid>(), It.IsAny<CancellationToken>())).ReturnsAsync(TestData.GetCompletedTransactionAggregate);
Mock<IAggregateRepositoryManager> aggregateRepositoryManager = new Mock<IAggregateRepositoryManager>();
aggregateRepositoryManager.Setup(a => a.GetAggregateRepository<TransactionAggregate>(It.IsAny<Guid>())).Returns(aggregateRepository.Object);
TransactionAggregateManager transactionAggregateManager = new TransactionAggregateManager(aggregateRepositoryManager.Object);

await transactionAggregateManager.RequestEmailReceipt(TestData.EstateId,
TestData.TransactionId,
TestData.CustomerEmailAddress,
CancellationToken.None);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ public async Task TransactionDomainService_ProcessSaleTransaction_SuccesfulOpera
TestData.TransactionNumber,
TestData.DeviceIdentifier,
TestData.OperatorIdentifier1,
TestData.CustomerEmailAddress,
TestData.AdditionalTransactionMetaData,
CancellationToken.None);

Expand Down Expand Up @@ -341,6 +342,7 @@ public async Task TransactionDomainService_ProcessSaleTransaction_FailedOperator
TestData.TransactionNumber,
TestData.DeviceIdentifier,
TestData.OperatorIdentifier1,
TestData.CustomerEmailAddress,
TestData.AdditionalTransactionMetaData,
CancellationToken.None);

Expand Down Expand Up @@ -379,6 +381,7 @@ public async Task TransactionDomainService_ProcessSaleTransaction_MerchantWithNu
TestData.TransactionNumber,
TestData.DeviceIdentifier,
TestData.OperatorIdentifier1,
TestData.CustomerEmailAddress,
TestData.AdditionalTransactionMetaData,
CancellationToken.None);

Expand Down Expand Up @@ -418,6 +421,7 @@ public async Task TransactionDomainService_ProcessSaleTransaction_MerchantWithNo
TestData.TransactionNumber,
TestData.DeviceIdentifier,
TestData.OperatorIdentifier1,
TestData.CustomerEmailAddress,
TestData.AdditionalTransactionMetaData,
CancellationToken.None);

Expand Down Expand Up @@ -456,6 +460,7 @@ public async Task TransactionDomainService_ProcessSaleTransaction_IncorrectDevic
TestData.TransactionNumber,
TestData.DeviceIdentifier1,
TestData.OperatorIdentifier1,
TestData.CustomerEmailAddress,
TestData.AdditionalTransactionMetaData,
CancellationToken.None);

Expand Down Expand Up @@ -494,6 +499,7 @@ public async Task TransactionDomainService_ProcessSaleTransaction_InvalidEstate_
TestData.TransactionNumber,
TestData.DeviceIdentifier1,
TestData.OperatorIdentifier1,
TestData.CustomerEmailAddress,
TestData.AdditionalTransactionMetaData,
CancellationToken.None);

Expand Down Expand Up @@ -532,6 +538,7 @@ public async Task TransactionDomainService_ProcessSaleTransaction_InvalidMerchan
TestData.TransactionNumber,
TestData.DeviceIdentifier1,
TestData.OperatorIdentifier1,
TestData.CustomerEmailAddress,
TestData.AdditionalTransactionMetaData,
CancellationToken.None);

Expand Down Expand Up @@ -570,6 +577,7 @@ public async Task TransactionDomainService_ProcessSaleTransaction_EstateWithEmpt
TestData.TransactionNumber,
TestData.DeviceIdentifier,
TestData.OperatorIdentifier1,
TestData.CustomerEmailAddress,
TestData.AdditionalTransactionMetaData,
CancellationToken.None);

Expand Down Expand Up @@ -608,6 +616,7 @@ public async Task TransactionDomainService_ProcessSaleTransaction_EstateWithNull
TestData.TransactionNumber,
TestData.DeviceIdentifier,
TestData.OperatorIdentifier1,
TestData.CustomerEmailAddress,
TestData.AdditionalTransactionMetaData,
CancellationToken.None);

Expand Down Expand Up @@ -646,6 +655,7 @@ public async Task TransactionDomainService_ProcessSaleTransaction_OperatorNotSup
TestData.TransactionNumber,
TestData.DeviceIdentifier,
TestData.OperatorIdentifier2,
TestData.CustomerEmailAddress,
TestData.AdditionalTransactionMetaData,
CancellationToken.None);

Expand Down Expand Up @@ -684,6 +694,7 @@ public async Task TransactionDomainService_ProcessSaleTransaction_MerchantWithEm
TestData.TransactionNumber,
TestData.DeviceIdentifier,
TestData.OperatorIdentifier1,
TestData.CustomerEmailAddress,
TestData.AdditionalTransactionMetaData,
CancellationToken.None);

Expand Down Expand Up @@ -722,6 +733,7 @@ public async Task TransactionDomainService_ProcessSaleTransaction_MerchantWithNu
TestData.TransactionNumber,
TestData.DeviceIdentifier,
TestData.OperatorIdentifier1,
TestData.CustomerEmailAddress,
TestData.AdditionalTransactionMetaData,
CancellationToken.None);

Expand Down Expand Up @@ -760,6 +772,7 @@ public async Task TransactionDomainService_ProcessSaleTransaction_OperatorNotSup
TestData.TransactionNumber,
TestData.DeviceIdentifier,
TestData.OperatorIdentifier1,
TestData.CustomerEmailAddress,
TestData.AdditionalTransactionMetaData,
CancellationToken.None);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/// <summary>
///
/// </summary>
/// <seealso cref="MediatR.IRequestHandler{TransactionProcessor.BusinessLogic.Requests.ProcessLogonTransactionRequest, TransactionProcessor.Models.ProcessLogonTransactionResponse}" />
/// <seealso cref="MediatR.IRequestHandler{ProcessLogonTransactionRequest, ProcessLogonTransactionResponse}" />
/// <seealso cref="" />
public class TransactionRequestHandler : IRequestHandler<ProcessLogonTransactionRequest, ProcessLogonTransactionResponse>,
IRequestHandler<ProcessSaleTransactionRequest, ProcessSaleTransactionResponse>
Expand Down Expand Up @@ -74,6 +74,7 @@ public async Task<ProcessSaleTransactionResponse> Handle(ProcessSaleTransactionR
request.TransactionNumber,
request.DeviceIdentifier,
request.OperatorIdentifier,
request.CustomerEmailAddress,
request.AdditionalTransactionMetadata,
cancellationToken);

Expand Down
Loading