Skip to content

Commit e09e3fb

Browse files
committed
test: Student getName
1 parent f837dfa commit e09e3fb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lab1/main_test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ test("Test Student's setName", () => {
4646
});
4747

4848
test("Test Student's getName", () => {
49-
// TODO
50-
throw new Error("Test not implemented");
49+
const student = new Student();
50+
// Test if getName returns empty string if name is undefined
51+
assert.strictEqual(student.getName(), '');
52+
// Test if getName returns the name set by setName
53+
student.setName('John');
54+
assert.strictEqual(student.getName(), 'John');
5155
});

0 commit comments

Comments
 (0)