Example #1
0
        public void TestCalm2()
        {
            DiscreteCellSink <int> c    = DiscreteCell.CreateSink(2);
            List <int>             @out = new List <int>();
            IListener l = Transaction.Run(() => c.Calm().Listen(@out.Add));

            c.Send(4);
            c.Send(2);
            c.Send(4);
            c.Send(4);
            c.Send(2);
            c.Send(2);
            l.Unlisten();
            CollectionAssert.AreEqual(new[] { 2, 4, 2, 4, 2 }, @out);
        }