public void CreateValidStudentTest() { Student student = new Student(10000, "Pesho Goshov"); Assert.IsTrue(student.Id == 10000); Assert.IsTrue(student.Name == "Pesho Goshov"); Assert.IsTrue(student.ToString() == "ID: 10000, Name: Pesho Goshov"); }
static void Main() { Student stOne = new Student("Ivan", "Stoqnov", "Georgiev", 133713371) { Phone = 887843423, Univerity = University.Sofiiski, Speciality = Speciality.Psihologiq, Faculty = Faculty.Filosofski, Course = "Filosofiq", Address = "Mladost 3", Email = "*****@*****.**", }; Student stTwo = new Student("Ivan", "Petrov", "Georgiev", 420); Student stThree = new Student("Pesho", "Peshev", "Goshev", 30); Student stFour = (Student)stOne.Clone(); stOne.Email = "*****@*****.**"; Console.WriteLine("Student one equal to student two: {0}",stOne.Equals(stTwo)); Console.WriteLine("Student one equal to student two: {0}", stOne == stTwo); Console.WriteLine("Student one not equal to student three: {0}", stOne != stThree); Console.WriteLine("Student one equal to student three: {0}", stOne.Equals(stThree)); Console.WriteLine(Environment.NewLine + "GetHashCode:"); Console.WriteLine(stOne.GetHashCode()); Console.WriteLine(Environment.NewLine + "Student.ToString():" + Environment.NewLine); Console.WriteLine(stOne.ToString()); Console.WriteLine(Environment.NewLine + "Cloned student:" + Environment.NewLine); Console.WriteLine(stFour); Console.Write(Environment.NewLine + "Student one compared to student two: "); Console.WriteLine(stOne.CompareTo(stTwo)); }