Skip to content

Commit 1602332

Browse files
committed
Create calculator.service.spec.ts
1 parent 9a0a5b7 commit 1602332

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { CalculatorService } from "./calculator.service";
2+
import { LoggerService } from "./logger.service";
3+
4+
// Test suit
5+
describe("CalculatorService", () => {
6+
// Specification
7+
it("should add two number", () => {
8+
const calculator = new CalculatorService(new LoggerService());
9+
10+
const result = calculator.add(2, 2);
11+
12+
expect(result).toBe(4);
13+
});
14+
15+
// Specification
16+
it("should subtract two number", () => {
17+
const calculator = new CalculatorService(new LoggerService());
18+
19+
const result = calculator.subtract(2, 2);
20+
21+
expect(result).toBe(0);
22+
});
23+
});

0 commit comments

Comments
 (0)