public void CanCompareEntitiesWithNoDomainSignatureProperties() {
            BaseObjectEqualityComparer<BaseObject> comparer = new BaseObjectEqualityComparer<BaseObject>();

            ConcreteEntityWithNoDomainSignatureProperties object1 = new ConcreteEntityWithNoDomainSignatureProperties() {
                Name = "Whatever"
            };
            ConcreteEntityWithNoDomainSignatureProperties object2 = new ConcreteEntityWithNoDomainSignatureProperties() {
                Name = "asdf"
            };
            Assert.That(comparer.Equals(object1, object2), Is.False);

            EntityIdSetter.SetIdOf<int>(object1, 1);
            EntityIdSetter.SetIdOf<int>(object2, 1);
            Assert.That(comparer.Equals(object1, object2));
        }
        public void CanCompareEntitiesWithNoDomainSignatureProperties()
        {
            var comparer = new BaseObjectEqualityComparer <BaseObject>();

            var object1 = new ConcreteEntityWithNoDomainSignatureProperties {
                Name = "Whatever"
            };
            var object2 = new ConcreteEntityWithNoDomainSignatureProperties {
                Name = @"asdf"
            };

            Assert.That(comparer.Equals(object1, object2), Is.False);

            EntityIdSetter.SetIdOf(object1, 1);
            EntityIdSetter.SetIdOf(object2, 1);
            Assert.That(comparer.Equals(object1, object2));
        }
Beispiel #3
0
        public void CanCompareEntitiesWithNoDomainSignatureProperties()
        {
            var comparer = new BaseObjectEqualityComparer <BaseObject>();

            var obj1 = new ConcreteEntityWithNoDomainSignatureProperties {
                Name = "Whatever"
            };
            var obj2 = new ConcreteEntityWithNoDomainSignatureProperties {
                Name = @"asdf"
            };

            comparer.Equals(obj1, obj2).Should().BeFalse();

            EntityIdSetter.SetIdOf(obj1, 1);
            EntityIdSetter.SetIdOf(obj2, 1);
            comparer.Equals(obj1, obj2).Should().BeTrue();
        }
        public void CanCompareEntitiesWithNoDomainSignatureProperties()
        {
            var comparer = new BaseObjectEqualityComparer<BaseObject>();

            var object1 = new ConcreteEntityWithNoDomainSignatureProperties
                              {
                                  Name = "Whatever"
                              };
            var object2 = new ConcreteEntityWithNoDomainSignatureProperties
                              {
                                  Name = "asdf"
                              };
            Assert.IsFalse(comparer.Equals(object1, object2));

            EntityIdSetter.SetIdOf(object1, 1);
            EntityIdSetter.SetIdOf(object2, 1);
            Assert.IsTrue(comparer.Equals(object1, object2));
        }