Example #1
0
        protected override void SetUp()
        {
            _factory = new TFactory();

            DisposableHandler.Reset();
            SomeHandler.Reset();
        }
Example #2
0
        protected override void SetUp()
        {
            _activationCtx = new TActivationContext();

            DisposableHandler.Reset();
            SomeHandler.Reset();
            StaticHandler.Reset();
        }
Example #3
0
        public void CanInjectMessageContext()
        {
            // since the built-in container adapter does not support ctor injection, we can't test this
            if (typeof(TFactory) == typeof(BuiltinContainerAdapterFactory))
            {
                return;
            }

            SomeHandler.Reset();

            factory.Register <IHandleMessages <string>, SomeHandler>();

            try
            {
                using (var bus = Configure.With(adapter)
                                 .Logging(l => l.ColoredConsole(LogLevel.Warn))
                                 .Transport(t => t.UseMsmq("test.containeradapter.input", "error"))
                                 .CreateBus()
                                 .Start())
                {
                    bus.SendLocal("hello there!");

                    var timeout = 5.Seconds();
                    if (!SomeHandler.WaitieThingie.WaitOne(timeout))
                    {
                        Assert.Fail("Did not receive message within {0} timeout", timeout);
                    }

                    SomeHandler.HadContext.ShouldBe(true);
                }
            }
            finally
            {
                MsmqUtil.Delete("test.containeradapter.input");
            }
        }