コード例 #1
0
        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);
        }
コード例 #2
0
        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>());
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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>());
        }