public void SimpleSubject_DisposedBehavior()
        {
            var s = new SimpleSubject <int>();

            var d1 = s.Subscribe();

            for (int i = 0; i < 2; i++)
            {
                s.Dispose();

                Assert.ThrowsException <ObjectDisposedException>(() => s.OnNext(42));
                Assert.ThrowsException <ObjectDisposedException>(() => s.OnError(new Exception()));
                Assert.ThrowsException <ObjectDisposedException>(() => s.OnCompleted());

                d1.Dispose();

                Assert.ThrowsException <ObjectDisposedException>(() => s.Subscribe());
            }
        }
Example #2
0
 public void OnCompleted()
 {
     _signalSubject.OnCompleted();
 }
Example #3
0
 public void OnCompleted()
 {
     _executedSubject.OnCompleted();
 }