示例#1
0
        public void CouldCompleteObserver(IMutableSeries <int, int> map)
        {
            var subscriber = new SumValuesObserver();
            var series     = map as Series <int, int>;
            var cursor     = (series + series).GetCursor();

            cursor.Source.Subscribe(subscriber);
            var expectedSum = 0;

            for (int i = 0; i < 10; i++)
            {
                map.Add(i, i);
                expectedSum += i;
            }

            Assert.IsFalse(subscriber.IsCompleted);
            map.Complete();
            Thread.Sleep(100);
            Assert.IsTrue(subscriber.IsCompleted);
            Thread.Sleep(1000);
            Assert.AreEqual(expectedSum * 2, subscriber.Sum);
        }
示例#2
0
 public void Complete()
 {
     _innerSeries.Complete();
 }
示例#3
0
 public void Complete()
 {
     MutableInner.Complete();
 }