public void TestStudentClone() { Student student = new Student("Nikolay Kostadinov", 10000); Student cloneStudent = (Student)student.Clone(); Assert.AreEqual(student.GetHashCode() == cloneStudent.GetHashCode(), false, "Invalid DeepCopy"); Assert.AreEqual(student.Equals(cloneStudent), false, "Invalid DeepCopy"); Assert.AreEqual(student.Name, cloneStudent.Name, "Invalid DeepCopy"); Assert.AreEqual(student.Id, cloneStudent.Id, "Invalid DeepCopy"); }
public void StudentCloneTest() { Student studentOne = new Student(); studentOne.FirstName = "Ivan"; studentOne.MiddleName = "Petrov"; studentOne.LastName = "Ivanov"; studentOne.Address = "Dolno Uino"; studentOne.Course = "C# OOP"; Student studentOneClone = (Student)studentOne.Clone(); Assert.IsTrue(studentOne.Equals(studentOneClone)); }