예제 #1
0
        public void TestDelay()
        {
            var             e    = new EventSink <char>();
            Behavior <char> b    = e.Hold(' ');
            var             @out = new List <char>();
            Listener        l    = e.Delay().Snapshot(b).Listen(x => { @out.Add(x); });

            e.Send('C');
            e.Send('B');
            e.Send('A');
            l.Unlisten();
            CollectionAssert.AreEqual(new[] { 'C', 'B', 'A' }, @out);
        }
예제 #2
0
 public void TestDelay()
 {
   var e = new EventSink<char>();
   Behavior<char> b = e.Hold(' ');
   var @out = new List<char>();
   Listener l = e.Delay().Snapshot(b).Listen(x => { @out.Add(x); });
   e.Send('C');
   e.Send('B');
   e.Send('A');
   l.Unlisten();
   CollectionAssert.AreEqual(new[] { 'C', 'B', 'A' }, @out);
 }