public void SendsEventWhenUpdated() { List <MockItem> list = new List <MockItem> { new MockItem { Id = 0, Description = "A" }, new MockItem { Id = 1, Description = "B" }, new MockItem { Id = 3, Description = "D" } }; var collection = new ObservableGroupedOrderedCollection <MockItem>(i => i.Id, i => i.Description, i => i.Description.Length); collection.ReplaceWith(list); var scheduler = new TestScheduler(); var observer = scheduler.CreateObserver <ICollectionChange>(); collection.CollectionChange.Subscribe(observer); var updated = new MockItem { Id = 1, Description = "C" }; collection.UpdateItem(updated.Id, updated); ICollectionChange change = new UpdateRowCollectionChange <MockItem>(new SectionedIndex(0, 1), updated); observer.Messages.AssertEqual( OnNext(0, change) ); }
private void update(UpdateRowCollectionChange <TModel> change) { tableView.ReloadRows(change.Index.ToIndexPaths(), UITableViewRowAnimation.Automatic); }