public void CollectionClassWithTwoDifferencesShouldReturnTwoVariances()
        {
            // Arrange
            var inner1 = new ImmutableClass(1, "tast");
            var inner2 = new ImmutableClass(2, "test");
            var list1 = new List<ImmutableClass> { inner1 };
            var list2 = new List<ImmutableClass> { inner2 };
            var c1 = new CollectionClass
            {
                ImmutableClasses = list1
            };

            var c2 = new CollectionClass
            {
                ImmutableClasses = list2
            };

            // Act
            List<ObjectVariance> variances = ObjectComparer.GetObjectVariances(c1, c2).ToList();

            // Assert
            Assert.NotEmpty(variances);
            Assert.Equal(2, variances.Count); // List comparison is count-based, so should be 2 differences

            // First variance
            Assert.Equal("Int1", variances[0].PropertyName);
            Assert.Equal(1, variances[0].PropertyValue1);
            Assert.Equal(2, variances[0].PropertyValue2);

            // First variance's parent
            Assert.NotNull(variances[0].ParentVariance);
            Assert.Equal("this[0]", variances[0].ParentVariance.PropertyName);
            Assert.Equal(inner1, variances[0].ParentVariance.PropertyValue1);
            Assert.Equal(inner2, variances[0].ParentVariance.PropertyValue2);

            // First variance's parent's parent
            Assert.NotNull(variances[0].ParentVariance.ParentVariance);
            Assert.Equal("ImmutableClasses", variances[0].ParentVariance.ParentVariance.PropertyName);
            Assert.Equal(list1, variances[0].ParentVariance.ParentVariance.PropertyValue1);
            Assert.Equal(list2, variances[0].ParentVariance.ParentVariance.PropertyValue2);

            // First variance's parent's parent's parent
            Assert.NotNull(variances[0].ParentVariance.ParentVariance.ParentVariance);
            Assert.Null(variances[0].ParentVariance.ParentVariance.ParentVariance.PropertyName);
            Assert.Equal(c1, variances[0].ParentVariance.ParentVariance.ParentVariance.PropertyValue1);
            Assert.Equal(c2, variances[0].ParentVariance.ParentVariance.ParentVariance.PropertyValue2);

            // Second variance
            Assert.Equal("String1", variances[1].PropertyName);
            Assert.Equal("tast", variances[1].PropertyValue1);
            Assert.Equal("test", variances[1].PropertyValue2);

            // Second variance's parent
            Assert.NotNull(variances[1].ParentVariance);
            Assert.Equal("this[0]", variances[1].ParentVariance.PropertyName);
            Assert.Equal(inner1, variances[1].ParentVariance.PropertyValue1);
            Assert.Equal(inner2, variances[1].ParentVariance.PropertyValue2);

            // First variance's parent's parent
            Assert.NotNull(variances[1].ParentVariance.ParentVariance);
            Assert.Equal("ImmutableClasses", variances[1].ParentVariance.ParentVariance.PropertyName);
            Assert.Equal(list1, variances[1].ParentVariance.ParentVariance.PropertyValue1);
            Assert.Equal(list2, variances[1].ParentVariance.ParentVariance.PropertyValue2);

            // Second variance's parent's parent's parent
            Assert.NotNull(variances[1].ParentVariance.ParentVariance.ParentVariance);
            Assert.Null(variances[1].ParentVariance.ParentVariance.ParentVariance.PropertyName);
            Assert.Equal(c1, variances[1].ParentVariance.ParentVariance.ParentVariance.PropertyValue1);
            Assert.Equal(c2, variances[1].ParentVariance.ParentVariance.ParentVariance.PropertyValue2);
            Assert.Null(variances[1].ParentVariance.ParentVariance.ParentVariance.ParentVariance);
        }
        public void CollectionClassContainingDifferentCollectionsShouldCompareUsingKeys()
        {
            // Arrange
            var c1 = new CollectionClass
            {
                Users = UserCollection1
            };

            var c2 = new CollectionClass
            {
                Users = UserCollection2
            };

            // Act
            List<ObjectVariance> variances = ObjectComparer.GetObjectVariances(c1, c2).ToList();

            // Assert
            Assert.Empty(variances);
        }