Example #1
0
        public void when_AddRangeAsync_is_called_then_Reset_event_fired()
        {
            var testSchedulerProvider = new TestDispatcherSchedulerProvider();

            var result = false;

            var bindableCollection = new BindableCollection<int>(testSchedulerProvider);

            bindableCollection.CollectionChanged += (sender, args) =>
                                                    {
                                                        if (args.Action == NotifyCollectionChangedAction.Reset)
                                                        {
                                                            result = true;
                                                        }
                                                    };

            bindableCollection.AddRangeAsync(Enumerable.Range(0, 1));

            Assert.That(result, Is.True);
        }
Example #2
0
        public void when_AddRangeAsync_is_called_then_Reset_event_fired()
        {
            var testSchedulerProvider = new TestDispatcherSchedulerProvider();

            var result = false;

            var bindableCollection = new BindableCollection <int>(testSchedulerProvider);

            bindableCollection.CollectionChanged += (sender, args) =>
            {
                if (args.Action == NotifyCollectionChangedAction.Reset)
                {
                    result = true;
                }
            };

            bindableCollection.AddRangeAsync(Enumerable.Range(0, 1));

            Assert.That(result, Is.True);
        }