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)); }
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(); }
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(); } }