Ejemplo n.º 1
0
        public void Where()
        {
            var chan = new Chan<int>();

            chan
                .Send(Enumerable.Range(0, 10))
                .ContinueWith(t => chan.Close());

            var counting =
                chan
                    .Where(item => item % 2 == 0)
                    .Count();

            if (!counting.Wait(TimeSpan.FromSeconds(10)))
            {
                Assert.Fail();
            }

            Assert.AreEqual(5, counting.Result);
        }