Skip to content

Commit 9fb0e1d

Browse files
committed
Add test case for the 26-50 tier
1 parent 434e0b8 commit 9fb0e1d

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ function calculateLicensePrice(licenseAmount: number): number {
1212
if (licenseAmount >= 11) {
1313
licensePrice = 219;
1414
}
15+
if (licenseAmount >= 26) {
16+
licensePrice = 199;
17+
}
1518

1619
return licensePrice;
1720
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@ describe("TieredPricing should", () => {
1616
test("return 2409 for eleven licenses", async () => {
1717
expect(tieredPricing(11)).toBe(2409);
1818
});
19+
20+
test("return 5373 for twenty seven licenses", async () => {
21+
expect(tieredPricing(27)).toBe(5373);
22+
});
1923
});

0 commit comments

Comments
 (0)