Exemplo n.º 1
0
        public void GroupBy_ObservableSourceReset_Update()
        {
            var update = false;

            var coll = new NotifyCollection <int>()
            {
                1, 2, 3, 4, 5, 6
            };

            var test = coll.GroupBy(i => i % 3);

            test.CollectionChanged += (o, e) =>
            {
                Assert.AreEqual(NotifyCollectionChangedAction.Reset, e.Action);
                update = true;
            };

            coll.Clear();

            Assert.IsTrue(update);
            Assert.AreEqual(0, test.Count());
        }
Exemplo n.º 2
0
        public void GroupBy_ObservableSourceReset_Update()
        {
            var update = false;

            var coll = new NotifyCollection<int>() { 1, 2, 3, 4, 5, 6 };

            var test = coll.GroupBy(i => i % 3);

            test.CollectionChanged += (o, e) =>
            {
                Assert.AreEqual(NotifyCollectionChangedAction.Reset, e.Action);
                update = true;
            };

            coll.Clear();

            Assert.IsTrue(update);
            Assert.AreEqual(0, test.Count());
        }