Skip to content

Commit 6a2e477

Browse files
committed
coverage 100%
1 parent 01554ce commit 6a2e477

File tree

150 files changed

+93043
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+93043
-5
lines changed

lab1/main_test.js

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,33 @@ const { MyClass, Student } = require('./main');
44

55
test("Test MyClass's addStudent", () => {
66
// TODO
7-
throw new Error("Test not implemented");
7+
const myClass = new MyClass();
8+
const student = new Student();
9+
student.setName('John');
10+
myClass.addStudent(student);
11+
assert.strictEqual(myClass.getStudentById(0), student);
812
});
913

1014
test("Test MyClass's getStudentById", () => {
1115
// TODO
12-
throw new Error("Test not implemented");
16+
const myClass = new MyClass();
17+
const student = new Student();
18+
student.setName('John');
19+
myClass.addStudent(student);
20+
assert.strictEqual(myClass.getStudentById(0), student);
21+
assert.strictEqual(myClass.getStudentById(999), null);
1322
});
1423

1524
test("Test Student's setName", () => {
1625
// TODO
17-
throw new Error("Test not implemented");
26+
const student = new Student();
27+
student.setName('John');
28+
assert.strictEqual(student.getName(), "John");
1829
});
1930

2031
test("Test Student's getName", () => {
2132
// TODO
22-
throw new Error("Test not implemented");
23-
});
33+
const student = new Student();
34+
student.setName('John');
35+
assert.strictEqual(student.getName(), "John");
36+
});

lab1/node_modules/.package-lock.json

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lab1/node_modules/@types/node/LICENSE

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lab1/node_modules/@types/node/README.md

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)