public void AddItemsTest()
        {
            List <CollectionContainer <int> > cc = new List <CollectionContainer <int> >();

            var observableCollection1 = new ObservableCollection <int>(new List <int>()
            {
                1, 2, 3
            });
            var rool1 = new ReadOnlyObservableList <int>(observableCollection1);
            var cc1   = new CollectionContainer <int>(rool1);

            cc.Add(cc1);

            var observableCollection2 = new ObservableCollection <int>(new List <int>()
            {
                7, 8, 9
            });
            var rool2 = new ReadOnlyObservableList <int>(observableCollection2);
            var cc2   = new CollectionContainer <int>(rool2);

            cc.Add(cc2);

            CompositeReadOnlyObservableCollectionSource <int> croocs = new CompositeReadOnlyObservableCollectionSource <int>(cc);

            observableCollection1.Add(4);
            observableCollection1.Add(5);
            observableCollection1.Add(6);

            var observableCollection3 = new ObservableCollection <int>(new List <int>()
            {
                10, 11, 12
            });
            var rool3 = new ReadOnlyObservableList <int>(observableCollection3);
            var cc3   = new CollectionContainer <int>(rool3);

            croocs.Add(cc3);

            var observableCollection4 = new ObservableCollection <int>(new List <int>()
            {
                13, 14, 15
            });
            var rool4 = new ReadOnlyObservableList <int>(observableCollection4);
            var cc4   = new CollectionContainer <int>(rool4);

            croocs.Add(cc4);

            var iterator = croocs.View;
            int i        = 1;

            foreach (var v in iterator)
            {
                Assert.AreEqual(v, i);
                i++;
            }

            Assert.AreEqual(i, 16);
        }
        public void OperationListWithTransformingTest()
        {
            var croocs     = new CompositeReadOnlyObservableCollectionSource <int>();
            var viewCroocs = croocs.View;
            TransformingReadOnlyObservableList <int, int> trool =
                new TransformingReadOnlyObservableList <int, int>(viewCroocs, Selector);

            var observableCollection1 = new ObservableCollection <int>(new List <int>()
            {
                0, 1, 2, 3
            });
            var rool1 = new ReadOnlyObservableList <int>(observableCollection1);
            var cc1   = new CollectionContainer <int>(rool1);

            croocs.Add(cc1);

            var observableCollection2 = new ObservableCollection <int>(new List <int>()
            {
                4, 5, 6
            });
            var rool2 = new ReadOnlyObservableList <int>(observableCollection2);
            var cc2   = new CollectionContainer <int>(rool2);

            croocs.Add(cc2);

            var observableCollection3 = new ObservableCollection <int>(new List <int>()
            {
                7, 8, 9
            });
            var rool3 = new ReadOnlyObservableList <int>(observableCollection3);
            var cc3   = new CollectionContainer <int>(rool3);

            var observableCollection4 = new ObservableCollection <int>(new List <int>()
            {
                10, 11, 12
            });
            var rool4 = new ReadOnlyObservableList <int>(observableCollection4);
            var cc4   = new CollectionContainer <int>(rool4);

            //[0 1 2 3 4 5 6]
            croocs.RemoveAt(1);
            //[0 1 2 3]
            croocs.Insert(0, cc3);
            //[7 8 9 0 1 2 3]
            croocs.Add(cc4);
            //[7 8 9 0 1 2 3 10 11 12]
            croocs.Move(0, 2);
            //[0 1 2 3 10 11 12 7 8 9]

            Assert.AreEqual(trool.Count, 10);
            Assert.AreEqual(trool[0], 0);
            Assert.AreEqual(trool[1], 1);
            Assert.AreEqual(trool[2], 2);
            Assert.AreEqual(trool[3], 3);
            Assert.AreEqual(trool[4], 10);
            Assert.AreEqual(trool[5], 11);
            Assert.AreEqual(trool[6], 12);
            Assert.AreEqual(trool[7], 7);
            Assert.AreEqual(trool[8], 8);
            Assert.AreEqual(trool[9], 9);
        }
        public void MoveListWithTransformingTest()
        {
            var croocs     = new CompositeReadOnlyObservableCollectionSource <int>();
            var viewCroocs = croocs.View;
            TransformingReadOnlyObservableList <int, int> trool = new TransformingReadOnlyObservableList <int, int>(viewCroocs, Selector);

            var observableCollection1 = new ObservableCollection <int>(new List <int>()
            {
                0, 1, 2, 3, 4
            });
            var rool1 = new ReadOnlyObservableList <int>(observableCollection1);
            var cc1   = new CollectionContainer <int>(rool1);

            croocs.Add(cc1);

            var observableCollection2 = new ObservableCollection <int>(new List <int>()
            {
                5, 6
            });
            var rool2 = new ReadOnlyObservableList <int>(observableCollection2);
            var cc2   = new CollectionContainer <int>(rool2);

            croocs.Add(cc2);

            var observableCollection3 = new ObservableCollection <int>(new List <int>()
            {
                7, 8, 9
            });
            var rool3 = new ReadOnlyObservableList <int>(observableCollection3);
            var cc3   = new CollectionContainer <int>(rool3);

            croocs.Add(cc3);

            var observableCollection4 = new ObservableCollection <int>(new List <int>()
            {
                10
            });
            var rool4 = new ReadOnlyObservableList <int>(observableCollection4);
            var cc4   = new CollectionContainer <int>(rool4);

            croocs.Add(cc4);

            var observableCollection5 = new ObservableCollection <int>(new List <int>()
            {
                11, 12, 13, 14
            });
            var rool5 = new ReadOnlyObservableList <int>(observableCollection5);
            var cc5   = new CollectionContainer <int>(rool5);

            croocs.Add(cc5);

            //[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14]
            croocs.Move(0, 4);
            //[5 6 7 8 9 10 11 12 13 14 0 1 2 3 4]
            croocs.Move(1, 3);
            //[5 6 10 11 12 13 14 7 8 9 0 1 2 3 4]
            croocs.Move(1, 4);
            //[5 6 11 12 13 14 7 8 9 0 1 2 3 4 10]

            var view = croocs.View;

            Assert.AreEqual(trool.Count, 15);
            Assert.AreEqual(trool[0], 5);
            Assert.AreEqual(trool[1], 6);
            Assert.AreEqual(trool[2], 11);
            Assert.AreEqual(trool[3], 12);
            Assert.AreEqual(trool[4], 13);
            Assert.AreEqual(trool[5], 14);
            Assert.AreEqual(trool[6], 7);
            Assert.AreEqual(trool[7], 8);
            Assert.AreEqual(trool[8], 9);
            Assert.AreEqual(trool[9], 0);
            Assert.AreEqual(trool[10], 1);
            Assert.AreEqual(trool[11], 2);
            Assert.AreEqual(trool[12], 3);
            Assert.AreEqual(trool[13], 4);
            Assert.AreEqual(trool[14], 10);
        }