public async Task Remove()
        {
            var list = new SortedListReactiveCollectionSource <int>();

            var notificationsTask = list.ReactiveCollection.Changes
                                    .Take(3)
                                    .ToArray()
                                    .ToTask();

            list.Add(1);
            list.Remove(1);

            await Verify(notificationsTask);
        }
示例#2
0
        public async Task Remove()
        {
            var list = new SortedListReactiveCollectionSource <int>();

            var notificationTask = list.ReactiveCollection.Changes
                                   .Skip(2)
                                   .FirstAsync()
                                   .ToTask();

            list.Add(1);
            list.Remove(1);

            var notification = await notificationTask;

            notification.Index.Should().Be(0);
            notification.Action.Should().Be(NotifyCollectionChangedAction.Remove);
            notification.NewItems.Should().BeEmpty();
            notification.OldItems.Should().Equals(1);
            notification.Current.Should().BeEmpty();
        }
        public async Task Remove()
        {
            var list = new SortedListReactiveCollectionSource<int>();

            var notificationTask = list.ReactiveCollection.Changes
                .Skip(2)
                .FirstAsync()
                .ToTask();

            list.Add(1);
            list.Remove(1);

            var notification = await notificationTask;

            notification.Index.Should().Be(0);
            notification.Action.Should().Be(NotifyCollectionChangedAction.Remove);
            notification.NewItems.Should().BeEmpty();
            notification.OldItems.Should().Equals(1);
            notification.Current.Should().BeEmpty();
        }