Пример #1
0
 public void TestAccum()
 {
     var ea = new FirableEvent<int>();
     var o = new List<int>();
     var sum = ea.Accum((a, s) => a + s, 100);
     var l = sum.Subscribe(o.Add);
     ea.Fire(5);
     ea.Fire(7);
     ea.Fire(1);
     ea.Fire(2);
     ea.Fire(3);
     l.Dispose();
     AssertArraysEqual(Arrays<int>.AsList(105, 112, 113, 115, 118), o);
 }