예제 #1
0
        public void RxTraceSourceOnError()
        {
            var source = CreateTraceSource();

            var ex = new Exception("Error");
            var xs = Observable.Throw <int>(ex);

            xs.TraceOnError(source).Subscribe(_ => { }, __ => { });

            AssertEqual(Listener.Messages, TraceDefaults.DefaultOnError(ex));
        }
예제 #2
0
        public void IxTraceSourceOnError()
        {
            var source = CreateTraceSource();

            var ex = new RxxMockException("Error");
            var xs = EnumerableEx.Throw <int>(ex);

            xs.TraceOnError(source).Catch <int, Exception>(_ => Enumerable.Empty <int>()).ForEach();

            AssertEqual(Listener.Messages, TraceDefaults.DefaultOnError(ex));
        }
        public void RxTraceOnError()
        {
            AddTraceListener();

            var ex = new Exception("Error");
            var xs = Observable.Throw <int>(ex);

            xs.TraceOnError().Subscribe(_ => { }, __ => { });

            AssertEqual(Listener.Messages, TraceDefaults.DefaultOnError(ex));

            RemoveTraceListener();
        }
예제 #4
0
        public void RxTraceSourceIdentityOnError()
        {
            var source = CreateTraceSource();

            var ex = new Exception("Error");
            var xs = Observable.Throw <int>(ex);

            for (int i = 0; i < 3; i++)
            {
                xs.TraceIdentityOnError(source).Subscribe(_ => { }, __ => { });

                string id = GetCurrentId();

                AssertEqual(Listener.Messages, TraceDefaults.DefaultOnError(id, ex));

                Listener.Clear();
            }
        }
        public void IxTraceSourceIdentityOnError()
        {
            var source = CreateTraceSource();

            var ex = new RxxMockException("Error");
            var xs = EnumerableEx.Throw <int>(ex);

            for (int i = 0; i < 3; i++)
            {
                xs.TraceIdentityOnError(source).Catch <int, Exception>(_ => Enumerable.Empty <int>()).ForEach();

                string id = GetCurrentId();

                AssertEqual(Listener.Messages, TraceDefaults.DefaultOnError(id, ex));

                Listener.Clear();
            }
        }