public void TestCourseFullClone() { const int StartStudentsID = 10000; const int MaxCourseCapacity = 30; const int LastStudentID = StartStudentsID + MaxCourseCapacity; Course course = new Course("Software Engineering"); for (uint id = StartStudentsID; id < LastStudentID; id++) { course.JoinCourse(new Student("Nikolay Kostadinov", id)); } course.LeaveCourse(new Student("Nikolay Kostadinov", 10029)); Course cloneCourse = (Course)course.Clone(); bool isEqual = CompareStudents(course, cloneCourse) && (course.Name == cloneCourse.Name); Assert.AreEqual(isEqual, true); }
public void TestCourseZeroClone() { Course course = new Course("Software Engineering"); Course cloneCourse = (Course)course.Clone(); Assert.AreNotSame(course, cloneCourse, "Clone doesn't work correct"); }