Ejemplo n.º 1
0
        public override int GetHashCode()
        {
            const int prime  = 37;
            int       result = 1;

            result = prime * result + ((nurse == null) ? 0 : nurse.GetHashCode());
            return(result);
        }
Ejemplo n.º 2
0
        public override int GetHashCode()
        {
            const int prime  = 31;
            int       result = 1;

            result = prime * result + ((day == null) ? 0 : day.GetHashCode());
            result = prime * result + ((nurse == null) ? 0 : nurse.GetHashCode());
            result = prime * result + ((shift == null) ? 0 : shift.GetHashCode());
            return(result);
        }
Ejemplo n.º 3
0
        public void Nurse_GetHashCode_ReturnsHashCodeUsingUidAndName()
        {
            var nurse = new Nurse {
                name = name, uid = uid
            };

            var sameNurse = new Nurse {
                name = name, uid = uid
            };

            Assert.Equal(nurse.GetHashCode(), sameNurse.GetHashCode());

            var otherNurse = new Nurse {
                name = name, uid = "20xy8z56"
            };

            Assert.NotEqual(nurse.GetHashCode(), otherNurse.GetHashCode());

            var anotherNurse = new Nurse {
                name = "Bucky Barnes", uid = uid
            };

            Assert.NotEqual(nurse.GetHashCode(), anotherNurse.GetHashCode());
        }