public void OnExceptionReceived() { var args = new ExceptionReceivedEventArgs(new Exception(), Guid.NewGuid().ToString()); var queue = Substitute.For <IBusMessageReciever>(); var handler = Substitute.For <IBusEventHandler <object> >(); handler.OnError(args.Action, args.Exception); var events = new BusEvents <object>(queue, handler); events.OnExceptionReceived(new object(), args); handler.Received().OnError(args.Action, args.Exception); }
public void OnExceptionReceivedExceptionNull() { var args = new ExceptionReceivedEventArgs(null, Guid.NewGuid().ToString()); var queue = Substitute.For <IBusMessageReciever>(); var handler = Substitute.For <IBusEventHandler <object> >(); handler.OnError(Arg.Any <string>(), Arg.Any <Exception>()); var events = new BusEvents <object>(queue, handler); events.OnExceptionReceived(new object(), args); handler.Received(0).OnError(Arg.Any <string>(), Arg.Any <Exception>()); }
public void OnExceptionReceived() { var args = new ExceptionReceivedEventArgs(new Exception(), Guid.NewGuid().ToString()); var queue = Substitute.For<IBusQueueReciever>(); var handler = Substitute.For<IBusEventHandler<object>>(); handler.OnError(args.Action, args.Exception); var events = new BusEvents<object>(queue, handler); events.OnExceptionReceived(new object(), args); handler.Received().OnError(args.Action, args.Exception); }
public void OnExceptionReceivedExceptionNull() { var args = new ExceptionReceivedEventArgs(null, Guid.NewGuid().ToString()); var queue = Substitute.For<IBusQueueReciever>(); var handler = Substitute.For<IBusEventHandler<object>>(); handler.OnError(Arg.Any<string>(), Arg.Any<Exception>()); var events = new BusEvents<object>(queue, handler); events.OnExceptionReceived(new object(), args); handler.Received(0).OnError(Arg.Any<string>(), Arg.Any<Exception>()); }