示例#1
0
        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);
        }
示例#2
0
 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);
 }