Skip to content

Commit

Permalink
test: Student getName
Browse files Browse the repository at this point in the history
  • Loading branch information
CTHua committed Feb 29, 2024
1 parent f837dfa commit e09e3fb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lab1/main_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ test("Test Student's setName", () => {
});

test("Test Student's getName", () => {
// TODO
throw new Error("Test not implemented");
const student = new Student();
// Test if getName returns empty string if name is undefined
assert.strictEqual(student.getName(), '');
// Test if getName returns the name set by setName
student.setName('John');
assert.strictEqual(student.getName(), 'John');
});

0 comments on commit e09e3fb

Please sign in to comment.