Skip to content

Commit

Permalink
finish coverage 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
ian60509 committed Feb 29, 2024
1 parent bb957c1 commit 436a44b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lab1/main_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,16 @@ test("Test MyClass's addStudent", () => {

test("Test MyClass's getStudentById", () => {
// TODO
const cls = new(MyClass)

const cls = new MyClass();
const s = new Student();
s.setName('Ian');
cls.addStudent(s);
cls.addStudent(new Student());

assert.strictEqual(null, cls.getStudentById(-1) );
assert.strictEqual(null, cls.getStudentById(3) )
assert.strictEqual(s, cls.getStudentById(0) )

});

test("Test Student's setName", () => {
Expand Down

0 comments on commit 436a44b

Please sign in to comment.