Skip to content

test(project_registry): add unit tests for issues #196, #197, #198, and #199 - #341

Merged
abayomicornelius merged 1 commit into
Heliobond:mainfrom
nomsoscript:test/project-registry-unit-tests-196-199
Jul 27, 2026
Merged

test(project_registry): add unit tests for issues #196, #197, #198, and #199#341
abayomicornelius merged 1 commit into
Heliobond:mainfrom
nomsoscript:test/project-registry-unit-tests-196-199

Conversation

@nomsoscript

Copy link
Copy Markdown

Closes #196
Closes #197
Closes #198
Closes #199

Description

This PR addresses four assigned unit test issues in \project_registry:

  1. Issue Add unit test for create_project() rejecting an empty URI #196 - Create project with empty URI: Added \ est_create_project_empty_uri_panics\ to verify that \create_project()\ rejects an empty URI string with \RegistryError::UriTooShort.
  2. Issue Add unit test verifying certify_project() rejects certifying an already-certified project #197 - Re-certifying an already-certified project: Added \AlreadyCertified\ error variant and updated \certify_project()\ to panic if a project is already certified with the target status. Added \ est_certify_already_certified_project_panics.
  3. Issue Add unit test for liquidate_collateral() rejecting liquidation before maturity #198 - Liquidate collateral before maturity: Updated \liquidate_collateral_internal()\ to check maturity date and reject liquidation attempt prior to project maturity date with \RegistryError::ProjectNotMature. Added \ est_liquidate_collateral_before_maturity_panics.
  4. Issue Add unit test verifying deposit_collateral() rejects a zero-amount deposit #199 - Deposit zero-amount collateral: Added \ est_deposit_zero_collateral_panics\ to verify \deposit_collateral()\ rejects zero-amount deposits with \RegistryError::CollateralNotPositive.

Changes

  • Modified \project_registry/src/types.rs: Added \AlreadyCertified\ variant (38) to \RegistryError.
  • Modified \project_registry/src/lib.rs: Added duplicate certification guard to \certify_project()\ and pre-maturity liquidation check to \liquidate_collateral_internal().
  • Modified \project_registry/src/test.rs: Added unit test cases for empty URI, duplicate certification, pre-maturity liquidation rejection, and zero collateral deposit.

Testing

  • Unit tests added under \project_registry/src/test.rs\ covering all negative cases.

@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@nomsoscript Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@abayomicornelius
abayomicornelius merged commit 42c8538 into Heliobond:main Jul 27, 2026
1 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants