Skip to content

Add missing test coverage for VoucherDomainService failure paths#1543

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

Add missing test coverage for VoucherDomainService failure paths#1543
StuartFerguson merged 4 commits intomasterfrom
copilot/update-test-coverage-voucher-service

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 23, 2026

VoucherDomainService lacked test coverage for aggregate fetch failures and save failures in both IssueVoucher and RedeemVoucher.

New Tests

IssueVoucher

  • VoucherDomainService_IssueVoucher_GetVoucherFailed_ErrorThrownGetLatest<VoucherAggregate> returns Result.Failure() after estate validation passes
  • VoucherDomainService_IssueVoucher_SaveFailed_ErrorThrownSave returns Result.Failure after successful generate/barcode/issue steps

RedeemVoucher

  • VoucherDomainService_RedeemVoucher_GetVoucherAggregateFailed_ErrorThrownGetLatest<VoucherAggregate> returns Result.Failure() after voucher projection is found in DB and estate validation passes
  • VoucherDomainService_RedeemVoucher_SaveFailed_ErrorThrownSave returns Result.Failure after successful redeem step

Each test asserts result.IsFailed.ShouldBeTrue(), consistent with the pattern used across other domain service test files (FloatDomainServiceTests, EstateDomainServiceTests).

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~VoucherDomainService --no-build (dns block)
    • Triggering command: /usr/bin/dotnet dotnet build TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj (dns block)
    • Triggering command: /usr/bin/dotnet dotnet restore TransactionProcessor.BusinessLogic.Tests/TransactionProcessor.BusinessLogic.Tests.csproj --ignore-failed-sources (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 Voucher Domain Service</issue_title>
<issue_description></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.

Copilot AI changed the title [WIP] Update test coverage on voucher domain service Add missing test coverage for VoucherDomainService failure paths Feb 23, 2026
Copilot AI requested a review from StuartFerguson February 23, 2026 16:10
@StuartFerguson StuartFerguson marked this pull request as ready for review February 23, 2026 16:57
@StuartFerguson StuartFerguson merged commit cbf1bc4 into master Feb 23, 2026
10 checks passed
@github-actions github-actions Bot deleted the copilot/update-test-coverage-voucher-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 Voucher Domain Service

2 participants