public void IgnoreUnknownMessages()
        {
            var container = Substitute.For<IRootContainer>();
            var context = Substitute.For<IDownstreamContext>();

            var handler = new IocHandler(container);
            handler.HandleDownstream(context, Substitute.For<StartHandlers>());

            container.DidNotReceive().CreateScope();
            context.DidNotReceive().SendDownstream(Arg.Any<StartHandlers>());
        }
Beispiel #2
0
        public void IgnoreUnknownMessages()
        {
            var container = Substitute.For <IRootContainer>();
            var context   = Substitute.For <IDownstreamContext>();

            var handler = new IocHandler(container);

            handler.HandleDownstream(context, Substitute.For <StartHandlers>());

            container.DidNotReceive().CreateScope();
            context.DidNotReceive().SendDownstream(Arg.Any <StartHandlers>());
        }
        public void Throws()
        {
            var container = Substitute.For<IRootContainer>();
            var context = Substitute.For<IDownstreamContext>();
            var child = Substitute.For<IScopedContainer>();
            container.CreateScope().Returns(child);
            var msg = new DispatchEvent(new FakeEvent());
            child.ResolveAll<ISubscribeOn<FakeEvent>>().Returns(call => { throw new Exception(); });

            var handler = new IocHandler(container);
            handler.HandleDownstream(context, msg);

            context.Received().SendUpstream(Arg.Any<EventFailed>());
        }
Beispiel #4
0
        public void Throws()
        {
            var container = Substitute.For <IRootContainer>();
            var context   = Substitute.For <IDownstreamContext>();
            var child     = Substitute.For <IScopedContainer>();

            container.CreateScope().Returns(child);
            var msg = new DispatchEvent(new FakeEvent());

            child.ResolveAll <ISubscribeOn <FakeEvent> >().Returns(call => { throw new Exception(); });

            var handler = new IocHandler(container);

            handler.HandleDownstream(context, msg);

            context.Received().SendUpstream(Arg.Any <EventFailed>());
        }