コード例 #1
0
        public void Run()
        {
            var args = new ExceptionReceivedEventArgs(new Exception(), Guid.NewGuid().ToString());
            var queue = Substitute.For<IBusQueueReciever>();
            queue.RegisterForEvents(Arg.Any<Func<BrokeredMessage, Task>>(), Arg.Any<OnMessageOptions>());
            var handler = Substitute.For<IBusEventHandler<object>>();

            var events = new BusEvents<object>(queue, handler);
            events.Run();

            queue.Received().RegisterForEvents(Arg.Any<Func<BrokeredMessage, Task>>(), Arg.Any<OnMessageOptions>());
        }
コード例 #2
0
        public void Run()
        {
            var args  = new ExceptionReceivedEventArgs(new Exception(), Guid.NewGuid().ToString());
            var queue = Substitute.For <IBusMessageReciever>();

            queue.RegisterForEvents(Arg.Any <Func <BrokeredMessage, Task> >(), Arg.Any <OnMessageOptions>());
            var handler = Substitute.For <IBusEventHandler <object> >();

            var events = new BusEvents <object>(queue, handler);

            events.Run();

            queue.Received().RegisterForEvents(Arg.Any <Func <BrokeredMessage, Task> >(), Arg.Any <OnMessageOptions>());
        }
コード例 #3
0
        public void Run()
        {
            var args  = new ExceptionReceivedEventArgs(new Exception(), Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), Guid.NewGuid().ToString());
            var queue = Substitute.For <IBusReciever>();

            queue.OnMessage(Arg.Any <Func <Message, CancellationToken, Task> >(), Arg.Any <MessageHandlerOptions>());
            var handler = Substitute.For <IBusEventHandler <object> >();

            var events = new BusEvents <object>(queue, handler);

            events.Run();

            queue.Received().OnMessage(Arg.Any <Func <Message, CancellationToken, Task> >(), Arg.Any <MessageHandlerOptions>());
        }