Ejemplo n.º 1
0
        public void ExpressionlessSourceManipulation()
        {
            var numbers = new SynchronizedRangeObservableCollection <int>();

            using var aggregate = numbers.ActiveMax();
            Assert.IsNotNull(aggregate.OperationFault);
            Assert.AreEqual(0, aggregate.Value);
            numbers.Add(1);
            Assert.IsNull(aggregate.OperationFault);
            Assert.AreEqual(1, aggregate.Value);
            numbers.AddRange(System.Linq.Enumerable.Range(2, 3));
            Assert.AreEqual(4, aggregate.Value);
            numbers.RemoveRange(0, 2);
            Assert.AreEqual(4, aggregate.Value);
            numbers.RemoveAt(1);
            Assert.AreEqual(3, aggregate.Value);
            numbers.Reset(System.Linq.Enumerable.Range(2, 3));
            Assert.AreEqual(4, aggregate.Value);
        }