Skip to content

Commit

Permalink
Remove unnecessary comment and stub code
Browse files Browse the repository at this point in the history
  • Loading branch information
Deron5566 committed Mar 7, 2024
1 parent fbea7e8 commit f351ec2
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions lab1/main_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,35 @@ const assert = require('assert');
const { MyClass, Student } = require('./main');

test("Test MyClass's addStudent", () => {
// TODO
const myClass = new MyClass();
const student = new Student();
student.setName('John');
assert.strictEqual(myClass.addStudent(student), 0);
assert.strictEqual(myClass.addStudent(123), -1);
// throw new Error("Test not implemented");
});

test("Test MyClass's getStudentById", () => {
// TODO
const myClass = new MyClass();
const student = new Student();
student.setName('John');
const newStudentId = myClass.addStudent(student);
assert.strictEqual(myClass.getStudentById(newStudentId), student);
assert.strictEqual(myClass.getStudentById(-2), null);
assert.strictEqual(myClass.getStudentById(2), null);
// throw new Error("Test not implemented");
});

test("Test Student's setName", () => {
// TODO
const myClass = new MyClass();
const student = new Student();
student.setName('John');
assert.strictEqual(student.name, 'John');
student.setName(123);
// throw new Error("Test not implemented");
});

test("Test Student's getName", () => {
// TODO
const myClass = new MyClass();
const student = new Student();
assert.strictEqual(student.getName(), '');
student.setName('John');
assert.strictEqual(student.getName(), 'John');
// throw new Error("Test not implemented");
});

0 comments on commit f351ec2

Please sign in to comment.