public async Task Clear() { var list = new SortedListReactiveCollectionSource <int>(); var notificationsTask = list.ReactiveCollection.Changes .Take(3) .ToArray() .ToTask(); list.Add(1); list.Clear(); await Verify(notificationsTask); }
public async Task Clear() { var list = new SortedListReactiveCollectionSource<int>(); var notificationTask = list.ReactiveCollection.Changes .Skip(2) .FirstAsync() .ToTask(); list.Add(1); list.Clear(); var notification = await notificationTask; notification.Index.Should().NotHaveValue(); notification.Action.Should().Be(NotifyCollectionChangedAction.Reset); notification.NewItems.Should().BeEmpty(); notification.OldItems.Should().BeEmpty(); notification.Current.Should().BeEmpty(); }
public async Task Clear() { var list = new SortedListReactiveCollectionSource <int>(); var notificationTask = list.ReactiveCollection.Changes .Skip(2) .FirstAsync() .ToTask(); list.Add(1); list.Clear(); var notification = await notificationTask; notification.Index.Should().NotHaveValue(); notification.Action.Should().Be(NotifyCollectionChangedAction.Reset); notification.NewItems.Should().BeEmpty(); notification.OldItems.Should().BeEmpty(); notification.Current.Should().BeEmpty(); }