Skip to content

Add error/exception case test coverage for ContractDomainService#1514

Merged
StuartFerguson merged 4 commits intomasterfrom
copilot/update-test-coverage-contract-domain
Feb 21, 2026
Merged

Add error/exception case test coverage for ContractDomainService#1514
StuartFerguson merged 4 commits intomasterfrom
copilot/update-test-coverage-contract-domain

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 21, 2026

Each ContractDomainService method lacked tests for failure paths — aggregate fetch failures, state change failures, save failures, and transient query failures were all uncovered.

New test cases

CreateContract

  • GetEstateFailed_ResultIsFailedGet<EstateAggregate> returns failure
  • GetContractFailed_ResultIsFailedGetLatest<ContractAggregate> returns failure
  • RunTransientQueryFailed_ResultIsFailedRunTransientQuery returns failure
  • SaveFailed_ResultIsFailedSave returns failure

AddProductToContract (FixedValue + VariableValue variants)

  • GetContractFailed_ResultIsFailed
  • SaveFailed_ResultIsFailed

AddTransactionFeeForProductToContract (4 calc/fee type combos each)

  • GetContractFailed_ResultIsFailed
  • SaveFailed_ResultIsFailed

DisableTransactionFeeForProduct

  • GetContractFailed_ResultIsFailed
  • StateChangeFailed_ResultIsFailed — fee/product not found on aggregate
  • SaveFailed_ResultIsFailed

All tests follow the existing pattern: mock the failing dependency, invoke the service method, assert result.IsFailed.

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 ContractDomainServiceTests -v minimal (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)
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/TransactionProcessor/TransactionProcessor/TransactionProcessor.sln --packages /home/REDACTED/work/TransactionProcessor/.codeql-scratch/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/home/REDACTED/work/TransactionProcessor/.codeql-scratch/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/home/REDACTED/work/TransactionProcessor/.codeql-scratch/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true (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 Contract Domain service</issue_title>
<issue_description>Each domain service method needs new tests added to cover all cases, mainly error and exception cases missing</issue_description>

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


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…on cases

Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Copilot AI changed the title [WIP] Update test coverage on contract domain service Add error/exception case test coverage for ContractDomainService Feb 21, 2026
Copilot AI requested a review from StuartFerguson February 21, 2026 08:53
@StuartFerguson StuartFerguson marked this pull request as ready for review February 21, 2026 09:33
@StuartFerguson StuartFerguson merged commit 3a69717 into master Feb 21, 2026
8 of 11 checks passed
@github-actions github-actions Bot deleted the copilot/update-test-coverage-contract-domain branch April 23, 2026 03:19
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 Contract Domain service

2 participants