예제 #1
0
        public void Compare_NonSimplePropertiesAreIgnored()
        {
            var comparer = MergeComparer <MergeTestObjectWithComplexMember> .Create(o => o.ID, true);

            var instance1 = new MergeTestObjectWithComplexMember()
            {
                ComplexMember1 = new MergeTestObject(),
                ComplexMember2 = new List <object>(new[] { "foo" })
            };

            var instance2 = new MergeTestObjectWithComplexMember()
            {
                ComplexMember1 = new MergeTestObject(),
                ComplexMember2 = new List <object>(new[] { "bar" })
            };

            var conflicts = comparer.CompareAlgorithm.Compare(instance1, instance2);

            Assert.AreEqual(0, conflicts.Count());
        }
예제 #2
0
        public void Compare_NonSimplePropertiesAreIgnored()
        {
            var comparer = MergeComparer<MergeTestObjectWithComplexMember>.Create(o => o.ID, true);

            var instance1 = new MergeTestObjectWithComplexMember()
            {
                ComplexMember1 = new MergeTestObject(),
                ComplexMember2 = new List<object>(new[] { "foo" })
            };

            var instance2 = new MergeTestObjectWithComplexMember()
            {
                ComplexMember1 = new MergeTestObject(),
                ComplexMember2 = new List<object>(new[] { "bar" })
            };

            var conflicts = comparer.CompareAlgorithm.Compare(instance1, instance2);

            Assert.AreEqual(0, conflicts.Count());
        }