public void TestFilterNotNull() { var e = new EventSink <string>(); var @out = new List <string>(); Listener l = e.FilterNotNull().Listen(s => { @out.Add(s); }); e.Send("tomato"); e.Send(null); e.Send("peach"); l.Unlisten(); CollectionAssert.AreEqual(new[] { "tomato", "peach" }, @out); }
public void TestFilterNotNull() { var e = new EventSink<string>(); var @out = new List<string>(); Listener l = e.FilterNotNull().Listen(s => { @out.Add(s); }); e.Send("tomato"); e.Send(null); e.Send("peach"); l.Unlisten(); CollectionAssert.AreEqual(new[] { "tomato", "peach" }, @out); }