Exemple #1
0
 public void TestGetStudentsPropertyShouldReturnDeepCopyOfTheList()
 {
     var testCourse = new Course("testCourseName");
     var testStudent = new Student(10001, "Test Student Name");
     testCourse.InsertStudent(testStudent);
     Assert.AreNotSame(testCourse.Students[0], testCourse.Students[0],
         "Student list property returns same student as first member, but should be copy.");
 }
Exemple #2
0
 public void TestGetStudentsPropertyShouldReturnDifferentObjectEachCall()
 {
     var testCourse = new Course("testCourseName");
     var testStudent = new Student(10001, "Test Student Name");
     testCourse.InsertStudent(testStudent);
     Assert.AreNotSame(testCourse.Students, testCourse.Students,
         "Student list property returns same object, but should be copy.");
 }
Exemple #3
0
 public void TestRemoveStudentsMethodShouldWorkProperly()
 {
     var testCourse = new Course("testCourseName");
     var testStudent = new Student(10001, "Test Student Name");
     testCourse.InsertStudent(testStudent);
     testCourse.RemoveStudent(testStudent);
     Assert.IsTrue(
         testCourse.Students.Count == 0,
         "Students list count is not equal to zero"
         );
 }
Exemple #4
0
 public void TestInsertStudentsMethodShouldWorkProperly()
 {
     var testCourse = new Course("testCourseName");
     var testStudent = new Student(10001, "Test Student Name");
     testCourse.InsertStudent(testStudent);
     Assert.AreEqual(
         testStudent.Name, 
         testCourse.Students[0].Name, 
         "First inserted student's name is not equal to the first name in the list"
         );
 }