public void Clone_Of_ChangeTrackingCollection_Should_Create_Deep_Copy()
        {
            // Arrange
            var database      = new MockNorthwind();
            var order         = database.Orders[0];
            var order3        = database.Orders[3];
            var customer      = order.Customer;
            var details       = order.OrderDetails;
            var changeTracker = new ChangeTrackingCollection <Order>(order, order3);

            // Act
            var clonedChangeTracker = changeTracker.Clone();

            // Assert
            Assert.NotSame(order, clonedChangeTracker[0]);
            Assert.NotSame(customer, clonedChangeTracker[0].Customer);
            Assert.NotSame(details, clonedChangeTracker[0].OrderDetails);
            Assert.True(order.IsEquatable(clonedChangeTracker[0]));
            Assert.True(customer.IsEquatable(clonedChangeTracker[0].Customer));
            Assert.True(object.ReferenceEquals(order.Customer, order3.Customer));
            Assert.False(object.ReferenceEquals(order.Customer, clonedChangeTracker[0].Customer));
            Assert.True(object.ReferenceEquals(clonedChangeTracker[0].Customer, clonedChangeTracker[1].Customer));
        }
        public void Clone_Of_ChangeTrackingCollection_Should_Create_Deep_Copy()
        {
            // Arrange
            var database = new MockNorthwind();
            var order = database.Orders[0];
            var order3 = database.Orders[3];
            var customer = order.Customer;
            var details = order.OrderDetails;
            var changeTracker = new ChangeTrackingCollection<Order>(order, order3);

            // Act
            var clonedChangeTracker = changeTracker.Clone();

            // Assert
            Assert.NotSame(order, clonedChangeTracker[0]);
            Assert.NotSame(customer, clonedChangeTracker[0].Customer);
            Assert.NotSame(details, clonedChangeTracker[0].OrderDetails);
            Assert.True(order.IsEquatable(clonedChangeTracker[0]));
            Assert.True(customer.IsEquatable(clonedChangeTracker[0].Customer));
            Assert.True(object.ReferenceEquals(order.Customer, order3.Customer));
            Assert.False(object.ReferenceEquals(order.Customer, clonedChangeTracker[0].Customer));
            Assert.True(object.ReferenceEquals(clonedChangeTracker[0].Customer, clonedChangeTracker[1].Customer));
        }