Esempio n. 1
0
        public void Filter_is_respected_by_instantiation()
        {
            var source  = new[] { 1, 2, 3, 4 };
            var subject = new ObservableCollectionView <int>(source, x => x % 2 == 0);

            subject.AssertAreEqual(new[] { 2, 4 });
        }
Esempio n. 2
0
        public void New_collection_gets_populated_from_source()
        {
            var source  = new[] { 1, 2, 3 };
            var subject = new ObservableCollectionView <int>(source);

            subject.AssertAreEqual(source);
        }
        public void New_collection_gets_populated_from_source()
        {
            var source = new[] { 1, 2, 3 };
            var subject = new ObservableCollectionView<int>(source);

            subject.AssertAreEqual(source);
        }
        public void Filter_is_respected_by_instantiation()
        {
            var source = new[] { 1, 2, 3, 4 };
            var subject = new ObservableCollectionView<int>(source, x => x % 2 == 0);

            subject.AssertAreEqual(new[] { 2, 4 });
        }
Esempio n. 5
0
        public void Sort_items_upon_instantiation()
        {
            var source = new ObservableCollection <int> {
                8, 3, 1, 5, 0, 4, 3
            };
            var subject = new ObservableCollectionView <int>(
                source,
                null,
                Comparer <int> .Default);

            subject.AssertAreEqual(new[] { 0, 1, 3, 3, 4, 5, 8 });
        }
Esempio n. 6
0
        public void New_items_preserve_sort_order()
        {
            var source = new ObservableCollection <int> {
                1, 5, 0
            };
            var subject = new ObservableCollectionView <int>(
                source,
                null,
                Comparer <int> .Default);

            source.Add(-2);
            source.Add(3);
            source.Add(3);
            source.Add(10);

            subject.AssertAreEqual(new[] { -2, 0, 1, 3, 3, 5, 10 });
        }
        public void Sort_items_upon_instantiation()
        {
            var source = new ObservableCollection<int> { 8, 3, 1, 5, 0, 4, 3 };
            var subject = new ObservableCollectionView<int>(
                source,
                null,
                Comparer<int>.Default);

            subject.AssertAreEqual(new[] { 0, 1, 3, 3, 4, 5, 8 });
        }
        public void New_items_preserve_sort_order()
        {
            var source = new ObservableCollection<int> { 1, 5, 0 };
            var subject = new ObservableCollectionView<int>(
                source,
                null,
                Comparer<int>.Default);

            source.Add(-2);
            source.Add(3);
            source.Add(3);
            source.Add(10);

            subject.AssertAreEqual(new[] { -2, 0, 1, 3, 3, 5, 10 });
        }