Exemplo n.º 1
0
        public void IdTest()
        {
            var entity = new Entity1("5");

            var entity2 = new Entity1("12");

            Assert.AreEqual(false, entity.Equals(entity2));
        }
Exemplo n.º 2
0
        public void CannotEquateObjectsWithSameIdButDifferentTypes()
        {
            var obj1 = new Entity1();
            var obj2 = new Entity2();

            EntityIdSetter.SetIdOf(obj1, 1);
            EntityIdSetter.SetIdOf(obj2, 1);

            // ReSharper disable once SuspiciousTypeConversion.Global
            obj1.Equals(obj2).Should().BeFalse();
        }