Skip to content

Commit 4859b9d

Browse files
Merge pull request #422 from TransactionProcessing/testing/#419_reviewdomainservicetests
Tests updated and added TxnValiationService
2 parents e63ddf6 + 71db0bb commit 4859b9d

File tree

13 files changed

+1575
-2111
lines changed

13 files changed

+1575
-2111
lines changed

TransactionProcessor.BusinessLogic.Tests/Services/SettlementDomainServiceTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public SettlementDomainServiceTests() {
4141
}
4242

4343
[Fact]
44-
public async Task TransactionDomainService_ProcessSettlement_SettlementIsProcessed()
44+
public async Task SettlementDomainService_ProcessSettlement_SettlementIsProcessed()
4545
{
4646
settlementAggregateRepository.Setup(s => s.GetLatestVersion(It.IsAny<Guid>(), It.IsAny<CancellationToken>()))
4747
.ReturnsAsync(TestData.GetSettlementAggregateWithPendingMerchantFees(10));
@@ -59,7 +59,7 @@ public async Task TransactionDomainService_ProcessSettlement_SettlementIsProcess
5959
}
6060

6161
[Fact]
62-
public async Task TransactionDomainService_ProcessSettlement_SettlementAggregateNotCreated_NothingProcessed()
62+
public async Task SettlementDomainService_ProcessSettlement_SettlementAggregateNotCreated_NothingProcessed()
6363
{
6464
settlementAggregateRepository.Setup(s => s.GetLatestVersion(It.IsAny<Guid>(), It.IsAny<CancellationToken>()))
6565
.ReturnsAsync(TestData.GetEmptySettlementAggregate);
@@ -75,7 +75,7 @@ public async Task TransactionDomainService_ProcessSettlement_SettlementAggregate
7575
}
7676

7777
[Fact]
78-
public async Task TransactionDomainService_ProcessSettlement_SettlementAggregateNoFeesToSettles_NothingProcessed()
78+
public async Task SettlementDomainService_ProcessSettlement_SettlementAggregateNoFeesToSettles_NothingProcessed()
7979
{
8080
settlementAggregateRepository.Setup(s => s.GetLatestVersion(It.IsAny<Guid>(), It.IsAny<CancellationToken>()))
8181
.ReturnsAsync(TestData.GetCreatedSettlementAggregate);
@@ -91,7 +91,7 @@ public async Task TransactionDomainService_ProcessSettlement_SettlementAggregate
9191
}
9292

9393
[Fact]
94-
public async Task TransactionDomainService_ProcessSettlement_AddSettledFeeThrownException_SettlementProcessed()
94+
public async Task SettlementDomainService_ProcessSettlement_AddSettledFeeThrownException_SettlementProcessed()
9595
{
9696
settlementAggregateRepository.Setup(s => s.GetLatestVersion(It.IsAny<Guid>(), It.IsAny<CancellationToken>()))
9797
.ReturnsAsync(TestData.GetSettlementAggregateWithPendingMerchantFees(10));

TransactionProcessor.BusinessLogic.Tests/Services/TransactionDomainServiceTests.cs

Lines changed: 301 additions & 1062 deletions
Large diffs are not rendered by default.

TransactionProcessor.BusinessLogic.Tests/Services/TransactionValidationServiceTests.cs

Lines changed: 839 additions & 0 deletions
Large diffs are not rendered by default.

TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net7.0</TargetFramework>
5-
<DebugType>None</DebugType>
5+
<DebugType>Full</DebugType>
66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
namespace TransactionProcessor.BusinessLogic.Services;
2+
3+
using System;
4+
using System.Threading;
5+
using System.Threading.Tasks;
6+
7+
public interface ITransactionValidationService{
8+
#region Methods
9+
10+
Task<(String responseMessage, TransactionResponseCode responseCode)> ValidateLogonTransaction(Guid estateId,
11+
Guid merchantId,
12+
String deviceIdentifier,
13+
CancellationToken cancellationToken);
14+
15+
Task<(String responseMessage, TransactionResponseCode responseCode)> ValidateReconciliationTransaction(Guid estateId,
16+
Guid merchantId,
17+
String deviceIdentifier,
18+
CancellationToken cancellationToken);
19+
20+
Task<(String responseMessage, TransactionResponseCode responseCode)> ValidateSaleTransaction(Guid estateId,
21+
Guid merchantId,
22+
Guid contractId,
23+
Guid productId,
24+
String deviceIdentifier,
25+
String operatorIdentifier,
26+
Decimal? transactionAmount,
27+
CancellationToken cancellationToken);
28+
29+
#endregion
30+
}

0 commit comments

Comments
 (0)