예제 #1
0
        public void Equality_Same(bool isCooling, bool isFanRunning, bool isHeating, bool isAuxHeat)
        {
            var obj1 = new HvacSystem()
            {
                IsCooling    = isCooling,
                IsFanRunning = isFanRunning,
                IsHeating    = isHeating,
                IsAuxHeat    = isAuxHeat,
            };

            var obj2 = new HvacSystem()
            {
                IsCooling    = isCooling,
                IsFanRunning = isFanRunning,
                IsHeating    = isHeating,
                IsAuxHeat    = isAuxHeat,
            };

            Assert.IsTrue(obj1.Equals(obj2));
            Assert.IsTrue(obj1.Equals((object)obj2));
            Assert.IsTrue(obj1 == obj2);
            Assert.IsTrue(obj1 == (object)obj2);
            Assert.IsFalse(obj1 != obj2);
            Assert.IsFalse(obj1 != (object)obj2);
        }
예제 #2
0
 private void AssertNotEqual(HvacSystem obj1, HvacSystem obj2)
 {
     Assert.IsFalse(obj1.Equals(obj2));
     Assert.IsFalse(obj1.Equals((object)obj2));
     Assert.IsFalse(obj1 == obj2);
     Assert.IsFalse(obj1 == (object)obj2);
     Assert.IsTrue(obj1 != obj2);
     Assert.IsTrue(obj1 != (object)obj2);
 }