Skip to content

Commit

Permalink
first try
Browse files Browse the repository at this point in the history
  • Loading branch information
gg-blog committed Feb 29, 2024
1 parent 01554ce commit 92ad692
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lab1/main_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,41 @@ const { MyClass, Student } = require('./main');

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

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

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

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

0 comments on commit 92ad692

Please sign in to comment.