public void Adding_Item_Should_Raise_PropertyChanged() { var target = new PerspexDictionary<string, string>(); var tracker = new PropertyChangedTracker(target); target.Add("foo", "bar"); Assert.Equal(new[] { "Count", "Item[foo]" }, tracker.Names); }
public void Adding_Item_Should_Raise_PropertyChanged() { var target = new PerspexDictionary <string, string>(); var tracker = new PropertyChangedTracker(target); target.Add("foo", "bar"); Assert.Equal(new[] { "Count", "Item[foo]" }, tracker.Names); }
public void Adding_Item_Should_Raise_CollectionChanged() { var target = new PerspexDictionary<string, string>(); var tracker = new CollectionChangedTracker(target); target.Add("foo", "bar"); Assert.NotNull(tracker.Args); Assert.Equal(NotifyCollectionChangedAction.Add, tracker.Args.Action); Assert.Equal(-1, tracker.Args.NewStartingIndex); Assert.Equal(1, tracker.Args.NewItems.Count); Assert.Equal(new KeyValuePair<string, string>("foo", "bar"), tracker.Args.NewItems[0]); }
public void Adding_Item_Should_Raise_CollectionChanged() { var target = new PerspexDictionary <string, string>(); var tracker = new CollectionChangedTracker(target); target.Add("foo", "bar"); Assert.NotNull(tracker.Args); Assert.Equal(NotifyCollectionChangedAction.Add, tracker.Args.Action); Assert.Equal(-1, tracker.Args.NewStartingIndex); Assert.Equal(1, tracker.Args.NewItems.Count); Assert.Equal(new KeyValuePair <string, string>("foo", "bar"), tracker.Args.NewItems[0]); }