Пример #1
0
        public void InsertRange()
        {
            var Value        = "";
            var Value2       = NotifyCollectionChangedAction.Move;
            var ListVariable = new BigBook.ObservableList <int>();

            ListVariable.PropertyChanged   += (x, y) => Value = y.PropertyName;
            ListVariable.CollectionChanged += (x, y) => Value2 = y.Action;
            ListVariable.InsertRange(0, new int[] { 1, 2, 3, 4, 5 });
            Assert.Equal("Count", Value);
            Assert.Equal(NotifyCollectionChangedAction.Add, Value2);
        }
Пример #2
0
        public void Clear()
        {
            var Value        = "";
            var Value2       = NotifyCollectionChangedAction.Move;
            var ListVariable = new BigBook.ObservableList <int>();

            ListVariable.PropertyChanged   += (x, y) => Value = y.PropertyName;
            ListVariable.CollectionChanged += (x, y) => Value2 = y.Action;
            ListVariable.Clear();
            Assert.Equal("Count", Value);
            Assert.Equal(NotifyCollectionChangedAction.Reset, Value2);
        }
Пример #3
0
        public void IndexSet()
        {
            var Value        = "";
            var Value2       = NotifyCollectionChangedAction.Move;
            var ListVariable = new BigBook.ObservableList <int>();

            ListVariable.PropertyChanged   += (x, y) => Value = y.PropertyName;
            ListVariable.CollectionChanged += (x, y) => Value2 = y.Action;
            ListVariable.Add(10);
            Value           = "";
            ListVariable[0] = 11;
            Assert.Equal("", Value);
            Assert.Equal(NotifyCollectionChangedAction.Replace, Value2);
        }
Пример #4
0
 public ObservableListTests()
 {
     TestObject = new BigBook.ObservableList <int>();
 }