individual test case for methods

to ensure completeness, every method should have their own individual test case.
This commit is contained in:
Mustafa Kemal Tuna 2021-01-12 23:17:01 +03:00 committed by GitHub
parent eb3b360dc3
commit 09f8ca8659
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,6 +10,11 @@ describe("calculator", function() {
calculator = new Calculator();
calculator.read();
});
it("the read method asks for two values using prompt and remembers them in object properties", function() {
assert.equal(calculator.a, 2);
assert.equal(calculator.b, 3);
});
it("when 2 and 3 are entered, the sum is 5", function() {
assert.equal(calculator.sum(), 5);