Skip to content

Add missing test coverage for SettlementDomainService#1542

Merged
StuartFerguson merged 3 commits intomasterfrom
copilot/update-test-coverage-settlement-service
Feb 23, 2026
Merged

Add missing test coverage for SettlementDomainService#1542
StuartFerguson merged 3 commits intomasterfrom
copilot/update-test-coverage-settlement-service

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 23, 2026

Each method in SettlementDomainService lacked tests for several failure and alternate-schedule paths. Adds 10 new unit tests across all three methods.

ProcessSettlement

  • GetSettlementAggregateFailedGetLatest<SettlementAggregate> returns a failure result
  • GetMerchantFailedGet<MerchantAggregate> returns a failure result (existing test only covered ThrowsAsync)
  • GetTransactionFailedGetLatest<TransactionAggregate> returns a failure result (same gap as above)
  • SaveSettlementAggregateFailed — non-retryable (non-WrongExpectedVersion) save failure on the scheduled path
  • WithScheduledSettlement_SettlementIsProcessed — happy path with SettlementSchedule.Weekly; all existing happy-path tests used Immediate via CreatedMerchantAggregate()

AddMerchantFeePendingSettlement

  • GetSettlementFailedGetLatest<SettlementAggregate> returns failure
  • SaveFailedSave returns failure
  • ExceptionThrown — unhandled exception caught by the method's try/catch

AddSettledFeeToSettlement

  • GetSettlementFailedGetLatest<SettlementAggregate> returns failure
  • WithScheduledSettlement_FeeAdded — exercises MarkFeeAsSettled (scheduled path) via SettlementSchedule.Weekly; all existing tests hit the Immediate path via CreatedMerchantAggregate()

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • f.feedz.io
    • Triggering command: /usr/bin/dotnet dotnet test TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj --filter FullyQualifiedName~SettlementDomainService --no-build -v n (dns block)
    • Triggering command: /usr/bin/dotnet dotnet test TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj --filter FullyQualifiedName~SettlementDomainService -v n (dns block)
    • Triggering command: /opt/hostedtoolcache/CodeQL/2.24.0/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp /opt/hostedtoolcache/CodeQL/2.24.0/x64/codeql/csharp/tools/linux64/Semmle.Autobuild.CSharp (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Update Test Coverage on Settlement Domain service</issue_title>
<issue_description>Each domain service method needs new tests added to cover all cases</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Copilot AI changed the title [WIP] Update test coverage on settlement domain service Add missing test coverage for SettlementDomainService Feb 23, 2026
Copilot AI requested a review from StuartFerguson February 23, 2026 15:32
@StuartFerguson StuartFerguson marked this pull request as ready for review February 23, 2026 15:50
@StuartFerguson StuartFerguson merged commit 4043a98 into master Feb 23, 2026
10 checks passed
@github-actions github-actions Bot deleted the copilot/update-test-coverage-settlement-service branch April 25, 2026 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Test Coverage on Settlement Domain service

2 participants