Beispiel #1
0
        public void CollectionChangedTest()
        {
            var s = new Subject <CollectionChanged <int> >();

            var target = s.ToReadOnlyReactiveCollection();

            target.Count.Is(0);
            s.OnNext(CollectionChanged <int> .Add(0, 10));
            s.OnNext(CollectionChanged <int> .Add(1, 2));

            target.Is(10, 2);

            s.OnNext(CollectionChanged <int> .Remove(0));
            target.Is(2);
            s.OnNext(CollectionChanged <int> .Add(1, 3));
            target.Is(2, 3);
            s.OnNext(CollectionChanged <int> .Replace(1, 100));
            target.Is(2, 100);
            s.OnNext(CollectionChanged <int> .Reset);
            target.Count.Is(0);
        }