コード例 #1
0
        public void Crash_OnSubscribe()
        {
            var cs = new CompletableSubject();

            cs.SubscribeSafe(new FailingCompletableObserver(true, true, true));

            Assert.False(cs.HasObserver());
        }
コード例 #2
0
        public void Crash_OnError()
        {
            var cs = new CompletableSubject();

            cs.SubscribeSafe(new FailingCompletableObserver(false, true, true));

            Assert.True(cs.HasObserver());

            cs.OnError(new InvalidOperationException("main"));
        }
コード例 #3
0
        public void Normal_Dispose()
        {
            var cs = new CompletableSubject();
            var to = new TestObserver <object>();

            cs.SubscribeSafe(to);

            Assert.True(cs.HasObserver());

            to.Dispose();

            Assert.False(cs.HasObserver());
        }