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