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); }
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); }