public void Removing_Item_Should_Raise_PropertyChanged() { var target = new PerspexDictionary <string, string>(); target["foo"] = "bar"; var tracker = new PropertyChangedTracker(target); target.Remove("foo"); Assert.Equal(new[] { "Count", "Item[foo]" }, tracker.Names); }
public void Removing_Item_Should_Raise_CollectionChanged() { var target = new PerspexDictionary <string, string>(); target["foo"] = "bar"; var tracker = new CollectionChangedTracker(target); target.Remove("foo"); Assert.NotNull(tracker.Args); Assert.Equal(NotifyCollectionChangedAction.Remove, tracker.Args.Action); Assert.Equal(-1, tracker.Args.OldStartingIndex); Assert.Equal(1, tracker.Args.OldItems.Count); Assert.Equal(new KeyValuePair <string, string>("foo", "bar"), tracker.Args.OldItems[0]); }
public void Removing_Item_Should_Raise_CollectionChanged() { var target = new PerspexDictionary<string, string>(); target["foo"] = "bar"; var tracker = new CollectionChangedTracker(target); target.Remove("foo"); Assert.NotNull(tracker.Args); Assert.Equal(NotifyCollectionChangedAction.Remove, tracker.Args.Action); Assert.Equal(-1, tracker.Args.OldStartingIndex); Assert.Equal(1, tracker.Args.OldItems.Count); Assert.Equal(new KeyValuePair<string, string>("foo", "bar"), tracker.Args.OldItems[0]); }
public void Removing_Item_Should_Raise_PropertyChanged() { var target = new PerspexDictionary<string, string>(); target["foo"] = "bar"; var tracker = new PropertyChangedTracker(target); target.Remove("foo"); Assert.Equal(new[] { "Count", "Item[foo]" }, tracker.Names); }