コード例 #1
0
        public void Stop_DisposesCurrentlyExecutingObservable()
        {
            var disposable = LiveSequence.Start(s =>
            {
                s.AddAction(() => _value = 1);
                s.Add(CreateTimer(10).DoOnCompleted(() => _value = 2));
                s.Add(() =>
                {
                    _value = 3;
                    return(CreateTimer(10)
                           .DoOnCompleted(() => _value = 4)
                           .DoOnCancel(() => _value = 100));
                });
                s.Add(CreateTimer(10).DoOnCompleted(() => _value = 5));
                s.AddAction(() => _value = 6);
            });

            AssertValue(1);

            _scheduler.AdvanceTo(10);
            AssertValue(3);

            disposable.Dispose();
            AssertValue(100);

            _scheduler.AdvanceTo(1000);
            AssertValue(100);
        }
コード例 #2
0
 public void Static_Start_DoesStartSequencer()
 {
     LiveSequence.Start(s => s.AddAction(() => _value = 123));
     AssertValue(123);
 }