@@ -3,58 +3,21 @@ const assert = require('assert');
33const { MyClass, Student } = require ( './main' ) ;
44
55test ( "Test MyClass's addStudent" , ( ) => {
6- const myClass = new MyClass ( ) ;
7- const student = new Student ( ) ;
8-
9- // Valid student case
10- const studentId = myClass . addStudent ( student ) ;
11- assert . strictEqual ( studentId , 0 ) ;
12-
13- // Invalid input case
14- const invalidId = myClass . addStudent ( { } ) ;
15- assert . strictEqual ( invalidId , - 1 ) ;
6+ // TODO
7+ throw new Error ( "Test not implemented" ) ;
168} ) ;
179
1810test ( "Test MyClass's getStudentById" , ( ) => {
19- const myClass = new MyClass ( ) ;
20- const student = new Student ( ) ;
21- student . setName ( "John" ) ;
22-
23- const studentId = myClass . addStudent ( student ) ;
24-
25- // Valid retrieval
26- const retrievedStudent = myClass . getStudentById ( studentId ) ;
27- assert . ok ( retrievedStudent instanceof Student ) ;
28- assert . strictEqual ( retrievedStudent . getName ( ) , "John" ) ;
29-
30- // Invalid ID cases
31- assert . strictEqual ( myClass . getStudentById ( - 1 ) , null ) ;
32- assert . strictEqual ( myClass . getStudentById ( 101 ) , null ) ;
11+ // TODO
12+ throw new Error ( "Test not implemented" ) ;
3313} ) ;
3414
35-
3615test ( "Test Student's setName" , ( ) => {
37- const student = new Student ( ) ;
38-
39- // Valid name setting
40- student . setName ( "Jane" ) ;
41- assert . strictEqual ( student . getName ( ) , "Jane" ) ;
42-
43- // Invalid input cases
44- student . setName ( 123 ) ;
45- assert . strictEqual ( student . getName ( ) , "Jane" ) ; // Should not change
46-
47- student . setName ( null ) ;
48- assert . strictEqual ( student . getName ( ) , "Jane" ) ; // Should not change
16+ // TODO
17+ throw new Error ( "Test not implemented" ) ;
4918} ) ;
5019
5120test ( "Test Student's getName" , ( ) => {
52- const student = new Student ( ) ;
53-
54- // Default value case
55- assert . strictEqual ( student . getName ( ) , '' ) ;
56-
57- // After setting a valid name
58- student . setName ( "Alice" ) ;
59- assert . strictEqual ( student . getName ( ) , "Alice" ) ;
21+ // TODO
22+ throw new Error ( "Test not implemented" ) ;
6023} ) ;
0 commit comments