Ejemplo n.º 1
0
        public void EqualsWithNullObjectReturnsFalse()
        {
            const SimpleDomainObject obj1 = null;
            var obj2 = new SimpleDomainObject();

            var equality = Equals(obj1, obj2);

            Assert.AreEqual(false, equality);
        }
Ejemplo n.º 2
0
        public void EqualsWithTwoNullObjectsReturnsTrue()
        {
            const SimpleDomainObject obj1 = null;
            const SimpleDomainObject obj2 = null;

            var equality = Equals(obj1, obj2);

            Assert.AreEqual(true, equality);
        }
Ejemplo n.º 3
0
        public void EqualsWithTransientObjectsReturnsFalse()
        {
            var obj1 = new SimpleDomainObject();
            var obj2 = new SimpleDomainObject();

            var equality = Equals(obj1, obj2);

            Assert.AreEqual(false, equality);
        }
Ejemplo n.º 4
0
        public void EqualsWithSameIdsReturnsTrue()
        {
            var obj1 = new SimpleDomainObject();
            var obj2 = new SimpleDomainObject();

            obj1.SetId(1);
            obj2.SetId(1);

            var equality = Equals(obj1, obj2);

            Assert.AreEqual(true, equality);
        }
Ejemplo n.º 5
0
        public void EqualsWithSameIdsInDisparateClassesReturnsFalse()
        {
            var obj1 = new SimpleDomainObject();
            var obj2 = new OtherSimpleDomainObject();

            obj1.SetId(1);
            obj2.SetId(1);

            var equality = Equals(obj1, obj2);

            Assert.AreEqual(false, equality);
        }
Ejemplo n.º 6
0
        public void EqualsWithDifferentIdsReturnsFalse()
        {
            var obj1 = new SimpleDomainObject();
            var obj2 = new SimpleDomainObject();

            obj1.SetId(1);
            obj2.SetId(2);

            var equality = Equals(obj1, obj2);

            Assert.AreEqual(false, equality);
        }