Skip to content

Commit 391bf18

Browse files
committed
implement fake it
1 parent fc57c08 commit 391bf18

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
export class Subscription {
22
constructor(private units: number) {}
3+
4+
getTotalPrice() {
5+
return 299;
6+
}
37
}

exercises/tiered_pricing/solutions/aortiz_typescript/tests/Subscription.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,10 @@ describe("Subscription", () => {
44
it("can be instantiated without throwing errors", () => {
55
expect(() => new Subscription(1)).not.toThrow(TypeError);
66
});
7+
8+
it("can be calculate subscription price of 1 unit", () => {
9+
const subscription = new Subscription(1);
10+
11+
expect(subscription.getTotalPrice()).toBe(299);
12+
});
713
});

0 commit comments

Comments
 (0)