- Create a C# Library Project - you can name it LoyaltyPoints.
- Copy
PointsCalculatorTest.cs
under projectPrivilegeServiceSpecs
. Add reference to NUnit in this project. - Copy
Tier.cs
,PrivilegeService.cs
,PointsCalculator.cs
,CustomerRepository.cs
andCustomer.cs
under projectPrivilegeService
. - Run the tests to get a green bar.
An airline has following rules for calculating bonus amount for loyalty points for a customer based on which tier they are in:
- If a customer is in Platinum tier, add 50% more points above regular points.
- If a customer is in Gold tier, add 30% more points above regular points.
- If a customer is in Silver tier, add 15% more points above regular points.
- If a customer is in Blue tier, then there are no bonus points, just regular points.
- Spending INR 100 earns a regular point.
How do you run this program?