示例#1
0
        public void GetHashCode_DifferentFields_DifferentHashCode()
        {
            unit1 = new TimeUnit(start, end);
            unit1.AssignedCourse = new Course("Test", 10, 10, new List<Resource>() { new Resource("TV") });
            unit2 = new TimeUnit(start.AddMinutes(1), end.AddMinutes(1));
            unit2.AssignedCourse = new Course("T", 10, 10, new List<Resource>() { new Resource("TV") });

            Assert.AreNotEqual(unit1, unit2);
            Assert.AreNotEqual(unit1.GetHashCode(), unit2.GetHashCode());
        }
示例#2
0
        public void GetHashCode_Clone_SameHashCode()
        {
            unit1 = new TimeUnit(start, end);
            unit1.AssignedCourse = new Course("Test", 10, 10, new List<Resource>() { new Resource("TV") });
            TimeUnit unit = (TimeUnit)unit1.Clone();

            Assert.AreEqual(unit, unit1);
            Assert.AreEqual(unit.GetHashCode(), unit1.GetHashCode());
        }