Skip to content

test(insurance): add zero/negative amount tests for create_policy (#76)#239

Open
tusharshah21 wants to merge 7 commits intoRemitwise-Org:mainfrom
tusharshah21:fix/issue-76-negative-amount-tests
Open

test(insurance): add zero/negative amount tests for create_policy (#76)#239
tusharshah21 wants to merge 7 commits intoRemitwise-Org:mainfrom
tusharshah21:fix/issue-76-negative-amount-tests

Conversation

@tusharshah21
Copy link

Summary

Adds four explicit tests to insurance's active test module to ensure create_policy always rejects zero and negative values for monthly_premium and coverage_amount, satisfying issue #76.

Changes

  • Added test_create_policy_zero_monthly_premium_panics — asserts monthly_premium == 0 is rejected
  • Added test_create_policy_negative_monthly_premium_panics — asserts monthly_premium < 0 is rejected
  • Added test_create_policy_zero_coverage_amount_panics — asserts coverage_amount == 0 is rejected
  • Added test_create_policy_negative_coverage_amount_panics — asserts coverage_amount < 0 is rejected

Scope

  • This PR intentionally avoids refactors, cleanups, and unrelated changes.
  • All modifications are limited to what is required by the issue.
  • Tests are placed inside the live #[cfg(test)] mod test {} block in lib.rs — the only compiled test module for this crate.

Verification

  • cargo test in insurance/ passes all 25 tests (4 new + 21 existing) with 0 failures.

Closes #76

@Baskarayelu
Copy link
Contributor

@tusharshah21 Can you please resolve the conflicts?

@tusharshah21
Copy link
Author

done mate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Negative Amount Tests for Insurance create_policy

2 participants