コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
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]);
        }
コード例 #4
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]);
        }