Example #1
0
        public void SourceManipulation()
        {
            var numbers = new RangeObservableCollection <int>(System.Linq.Enumerable.Range(0, 10));

            using (var query = numbers.ActiveElementAtOrDefault(9))
            {
                Assert.IsNull(query.OperationFault);
                Assert.AreEqual(9, query.Value);
                numbers.Remove(9);
                Assert.IsNull(query.OperationFault);
                Assert.AreEqual(0, query.Value);
                numbers.Add(30);
                Assert.IsNull(query.OperationFault);
                Assert.AreEqual(30, query.Value);
                numbers.Insert(9, 15);
                Assert.IsNull(query.OperationFault);
                Assert.AreEqual(15, query.Value);
            }
        }