Beispiel #1
0
        public void TestOverrideEquals()
        {
            Student student1 = new Student("Morten", "Et eller andet sted", 3, Gender.Male);
            Student student2 = new Student("Lucas", "Et andet sted", 3, Gender.Male);
            Student student3 = new Student("Morten", "Et eller andet sted", 3, Gender.Male);


            Assert.IsFalse(student1.Equals(student2));
            Assert.IsFalse(student2.Equals(student1));
            Assert.IsTrue(student1.Equals(student3));
        }
Beispiel #2
0
        public void StudentEqualsTest()
        {
            Student student  = new Student("Alex", "Pmi-32", "KlakovichLM");
            Student student2 = new Student("Alex", "Pmi-32", "KlakovichLM");
            bool    expected = true;
            bool    actual   = student.Equals(student2);

            Assert.AreEqual(actual, expected);
        }