public void GetStudentByIdShouldReturnTheStudentWithTheId() { var student1 = new Student("Pesho"); var student2 = new Student("Pesho"); var school = new SchoolClass(); int student1Id = school.RecordStudent(student1); int student2Id = school.RecordStudent(student2); Assert.AreSame(student1, school.GetStudentById(student1Id), "The first student is not the same as the returned student with the first id"); Assert.AreSame(student2, school.GetStudentById(student2Id), "The second student is not the same as the returned student with the second id"); }
public void GetStudentByIdShouldReturnNullWhenStudentIdIsNotFound() { var school = new SchoolClass(); var student = new Student("Pesho"); var id = school.RecordStudent(student); var notExistingId = id + 1; Assert.IsNull(school.GetStudentById(notExistingId)); }