protected override void DoTearDown() { CleanUpTrackedDisposables(); RabbitMqFixtureBase.DeleteQueue(InputQueueName); RabbitMqFixtureBase.DeleteQueue(AuditQueueName); }
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(); }
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); }
protected override IDuplexTransport CreateTransport(string inputQueueName) { RegisterForDisposal(new DisposableAction(() => RabbitMqFixtureBase.DeleteQueue(inputQueueName))); return(new RabbitMqMessageQueue(RabbitMqFixtureBase.ConnectionString, inputQueueName).PurgeInputQueue()); }