Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completed RewardValue Class and Unit Tests for Cash-to-Miles and Miles-to-Cash Conversions #1440

Open
wants to merge 2 commits into
base: flow
Choose a base branch
from

Conversation

Rehan-Pathan
Copy link

This pull request finalizes the implementation of the RewardValue class and completes the associated unit tests. The following changes were made:

Implemented RewardValue Class:

Added two constructors for handling both cash and miles input. The class handles the conversion between cash and miles using a predefined conversion rate.
cashValue is converted to milesValue using a conversion rate of 1 mile = $0.0035 and vice versa.
Added Unit Tests:

Test 1: Cash to Miles Conversion: Verifies that cash is properly converted to miles using the conversion rate (cash ÷ 0.0035 = miles).
Test 2: Miles to Cash Conversion: Ensures miles are accurately converted to cash using the reverse conversion (miles × 0.0035 = cash).
Both tests now pass, confirming that the conversion logic works as expected. The class now provides accurate conversions between cash and miles, covering key edge cases.

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.

1 participant