Skip to content

Commit 6ebe93b

Browse files
committed
Add test case for the last tier
1 parent 90fad78 commit 6ebe93b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

exercises/tiered_pricing/solutions/xetxeberria-ts/src/tieredPricing.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ function calculateLicensePrice(licenseAmount: number): number {
1010
if (licenseAmount >= 3) licensePrice = 239;
1111
if (licenseAmount >= 11) licensePrice = 219;
1212
if (licenseAmount >= 26) licensePrice = 199;
13+
if (licenseAmount >= 51) licensePrice = 149;
1314

1415
return licensePrice;
1516
}

exercises/tiered_pricing/solutions/xetxeberria-ts/tests/tieredPricing.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@ describe("TieredPricing should", () => {
2020
test("return 5373 for 27 licenses", async () => {
2121
expect(tieredPricing(27)).toBe(5373);
2222
});
23+
24+
test("return 7599 for 51 licenses", async () => {
25+
expect(tieredPricing(51)).toBe(7599);
26+
});
2327
});

0 commit comments

Comments
 (0)