예제 #1
0
 public void TestApply()
 {
     CellSink<Func<long, string>> bf = new CellSink<Func<long, string>>(b => "1 " + b);
     CellSink<long> ba = new CellSink<long>(5L);
     List<string> @out = new List<string>();
     using (ba.Apply(bf).Listen(@out.Add))
     {
         bf.Send(b => "12 " + b);
         ba.Send(6L);
     }
     CollectionAssert.AreEqual(new[] { "1 5", "12 5", "12 6" }, @out);
 }
예제 #2
0
        public void TestApply()
        {
            CellSink <Func <long, string> > cf = new CellSink <Func <long, string> >(x => "1 " + x);
            CellSink <long> ca   = new CellSink <long>(5L);
            List <string>   @out = new List <string>();

            using (ca.Apply(cf).Listen(@out.Add))
            {
                cf.Send(x => "12 " + x);
                ca.Send(6L);
            }
            CollectionAssert.AreEqual(new[] { "1 5", "12 5", "12 6" }, @out);
        }
예제 #3
0
        public void TestApply()
        {
            CellSink <Func <long, string> > bf = new CellSink <Func <long, string> >(b => "1 " + b);
            CellSink <long> ba   = new CellSink <long>(5L);
            List <string>   @out = new List <string>();

            using (ba.Apply(bf).Listen(@out.Add))
            {
                bf.Send(b => "12 " + b);
                ba.Send(6L);
            }
            CollectionAssert.AreEqual(new[] { "1 5", "12 5", "12 6" }, @out);
        }
예제 #4
0
 public void TestApply()
 {
     CellSink<Func<long, string>> cf = new CellSink<Func<long, string>>(x => "1 " + x);
     CellSink<long> ca = new CellSink<long>(5L);
     List<string> @out = new List<string>();
     using (ca.Apply(cf).Listen(@out.Add))
     {
         cf.Send(x => "12 " + x);
         ca.Send(6L);
     }
     CollectionAssert.AreEqual(new[] { "1 5", "12 5", "12 6" }, @out);
 }