コード例 #1
0
        protected override void DoTearDown()
        {
            CleanUpTrackedDisposables();

            RabbitMqFixtureBase.DeleteQueue(InputQueueName);
            RabbitMqFixtureBase.DeleteQueue(AuditQueueName);
        }
コード例 #2
0
        protected override void DoSetUp()
        {
            adapter = TrackDisposable(new BuiltinContainerAdapter());

            Configure.With(adapter)
                .Transport(t => t.UseRabbitMq(RabbitMqFixtureBase.ConnectionString, InputQueueName, "error"))
                .Behavior(b => b.EnableMessageAudit(AuditQueueName))
                .CreateBus()
                .Start(1);

            RabbitMqFixtureBase.DeleteQueue(AuditQueueName);

            // make sure the receiver is in place at this point, ensuring that bindings'n'all are in place...
            auditQueueReceiver = TrackDisposable(new RabbitMqMessageQueue(RabbitMqFixtureBase.ConnectionString, AuditQueueName));
            auditQueueReceiver.Initialize();
        }
コード例 #3
0
        IBus Create(string inputQueueName, Action <SomeEvent> eventHandler = null)
        {
            RabbitMqFixtureBase.DeleteQueue(inputQueueName);

            var adapter = new BuiltinContainerAdapter();

            if (eventHandler != null)
            {
                adapter.Handle(eventHandler);
            }

            Configure.With(adapter)
            .Transport(t => t.UseRabbitMq(RabbitMqFixtureBase.ConnectionString,
                                          inputQueueName,
                                          "test.resilience.error")
                       .ManageSubscriptions())
            .CreateBus()
            .Start();

            TrackDisposable(adapter);

            return(adapter.Bus);
        }
コード例 #4
0
 protected override IDuplexTransport CreateTransport(string inputQueueName)
 {
     RegisterForDisposal(new DisposableAction(() => RabbitMqFixtureBase.DeleteQueue(inputQueueName)));
     return(new RabbitMqMessageQueue(RabbitMqFixtureBase.ConnectionString, inputQueueName).PurgeInputQueue());
 }