Example #1
0
        public void TestApply()
        {
            DiscreteCellSink <Func <long, string> > cf = DiscreteCell.CreateSink <Func <long, string> >(x => "1 " + x);
            DiscreteCellSink <long> ca   = DiscreteCell.CreateSink(5L);
            List <string>           @out = new List <string>();
            IListener l = ca.Apply(cf).Listen(@out.Add);

            cf.Send(x => "12 " + x);
            ca.Send(6L);
            l.Unlisten();
            CollectionAssert.AreEqual(new[] { "1 5", "12 5", "12 6" }, @out);
        }