public void IxTraceSourceOnErrorFormat() { var source = CreateTraceSource(); var ex = new RxxMockException("Error"); var xs = EnumerableEx.Throw<int>(ex); xs.TraceOnError(source, "OnError: {0}").Catch<int, Exception>(_ => Enumerable.Empty<int>()).ForEach(); AssertEqual(Listener.Messages, "OnError: " + ex.ToString()); }
public void IxTraceSourceOnErrorFormat() { var source = CreateTraceSource(); var ex = new RxxMockException("Error"); var xs = EnumerableEx.Throw <int>(ex); xs.TraceOnError(source, "OnError: {0}").Catch <int, Exception>(_ => Enumerable.Empty <int>()).ForEach(); AssertEqual(Listener.Messages, "OnError: " + ex.ToString()); }
public void IxTraceSourceIdentityOnErrorFormat() { var source = CreateTraceSource(); var ex = new RxxMockException("Error"); var xs = EnumerableEx.Throw <int>(ex); for (int i = 0; i < 3; i++) { xs.TraceIdentityOnError(source, "OnError: {0}={1}").Catch <int, Exception>(_ => Enumerable.Empty <int>()).ForEach(); string id = GetCurrentId(); AssertEqual(Listener.Messages, "OnError: " + id + "=" + ex.ToString()); Listener.Clear(); } }
public void IxTraceSourceIdentityOnErrorFormat() { var source = CreateTraceSource(); var ex = new RxxMockException("Error"); var xs = EnumerableEx.Throw<int>(ex); for (int i = 0; i < 3; i++) { xs.TraceIdentityOnError(source, "OnError: {0}={1}").Catch<int, Exception>(_ => Enumerable.Empty<int>()).ForEach(); string id = GetCurrentId(); AssertEqual(Listener.Messages, "OnError: " + id + "=" + ex.ToString()); Listener.Clear(); } }