Skip to content

Commit

Permalink
test: add MyClass's getStudentById test
Browse files Browse the repository at this point in the history
  • Loading branch information
visitorckw committed Mar 1, 2024
1 parent e4f6211 commit 243e795
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lab1/main_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ test("Test MyClass's addStudent", () => {
});

test("Test MyClass's getStudentById", () => {

let class1 = new MyClass();
let student = new Student();
class1.addStudent(student);
assert.strictEqual(class1.getStudentById(-1), null);
assert.strictEqual(class1.getStudentById(0), student);
});

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

0 comments on commit 243e795

Please sign in to comment.