public void CanWrapCollectionCollection() { var originalCollection = new ObservableCollection<ItemMetadata>(); IViewsCollection viewsCollection = new ViewsCollection(originalCollection, x => true); Assert.AreEqual(0, viewsCollection.Count()); var item = new object(); originalCollection.Add(new ItemMetadata(item)); Assert.AreEqual(1, viewsCollection.Count()); Assert.AreSame(item, viewsCollection.First()); }
public void CanFilterCollection() { var originalCollection = new ObservableCollection<ItemMetadata>(); IViewsCollection viewsCollection = new ViewsCollection(originalCollection, x => x.Name == "Posible"); originalCollection.Add(new ItemMetadata(new object())); Assert.AreEqual(0, viewsCollection.Count()); var item = new object(); originalCollection.Add(new ItemMetadata(item) { Name = "Posible" }); Assert.AreEqual(1, viewsCollection.Count()); Assert.AreSame(item, viewsCollection.First()); }
public async Task CanWrapCollectionCollection() { await ExecuteOnUIThread(() => { var originalCollection = new ObservableCollection<ItemMetadata>(); IViewsCollection viewsCollection = new ViewsCollection(originalCollection, x => true); Assert.AreEqual(0, viewsCollection.Count()); var item = new object(); originalCollection.Add(new ItemMetadata(item)); Assert.AreEqual(1, viewsCollection.Count()); Assert.AreSame(item, viewsCollection.First()); }); }