Skip to content

Commit 09f8ca8

Browse files
authored
individual test case for methods
to ensure completeness, every method should have their own individual test case.
1 parent eb3b360 commit 09f8ca8

File tree

1 file changed

+5
-0
lines changed
  • 1-js/04-object-basics/06-constructor-new/2-calculator-constructor/_js.view

1 file changed

+5
-0
lines changed

1-js/04-object-basics/06-constructor-new/2-calculator-constructor/_js.view/test.js

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ describe("calculator", function() {
1010
calculator = new Calculator();
1111
calculator.read();
1212
});
13+
14+
it("the read method asks for two values using prompt and remembers them in object properties", function() {
15+
assert.equal(calculator.a, 2);
16+
assert.equal(calculator.b, 3);
17+
});
1318

1419
it("when 2 and 3 are entered, the sum is 5", function() {
1520
assert.equal(calculator.sum(), 5);

0 commit comments

Comments
 (0)