public void Setup() { Helper.SetupTestMessagingWithoutPurging(); MessagingSystem.Events.AddEventHook<ConsoleEventHook>(); _receiver = MessagingSystem.Receiver(); senderNode = MessagingSystem.Sender(); }
public void SetUp() { event_hook = new HoldingEventHook(); ObjectFactory.Configure(map => map.For<IEventHook>().Use(event_hook)); node_factory = MessagingSystem.Receiver(); senderNode = MessagingSystem.Sender(); }
public void SetUp() { ConfigureMessaging(); _receiver = MessagingSystem.Receiver(); _sender = MessagingSystem.Sender(); MessagingSystem.Events.ClearEventHooks(); MessagingSystem.Events.AddEventHook<ConsoleEventHook>(); }
public void SetUp() { // Start messaging, put everything in place Helper.SetupTestMessaging(); _receiver = MessagingSystem.Receiver(); _senderNode = MessagingSystem.Sender(); using (_receiver.Listen(_=>_.Handle<IColourMessage>().With<ColourMessageHandler>())) { } _senderNode.SendMessage(new GreenMessage()); MessagingSystem.Control.Shutdown(); // should cause message to flush // Start messaging again with purging: Helper.SetupTestMessaging(); }
public void setup() { MessagingSystem.Configure.WithDefaults().SetMessagingServer("reallyNotAServerAtAll").SetIntegrationTestMode(); MessagingSystem.Events.ClearEventHooks(); _failingMessagingBase = Substitute.For<IMessagingBase>(); _failingMessagingBase.PrepareForSend(Arg.Any<object>()) .Returns(new PreparedMessage("","")); _failingMessagingBase.When(m=>m.SendPrepared(Arg.Any<IPreparedMessage>())) .Do(c=> { throw new Exception("test exception"); }); ObjectFactory.Configure(map => map.For<IMessagingBase>().Use(_failingMessagingBase)); _subject = MessagingSystem.Sender(); }
public void a_set_of_configured_components_being_shut_down() { MessagingSystem.Control.Shutdown(); _receiverControl = Substitute.For<IReceiverControl>(); _channelAction = Substitute.For<IChannelAction>(); _sender = Substitute.For<ISenderNode>(); _rabbitConn = Substitute.For<IRabbitMqConnection>(); ObjectFactory.Configure(map => { map.For<IReceiverControl>().Use(_receiverControl); map.For<IChannelAction>().Use(_channelAction); map.For<ISenderNode>().Use(_sender); map.For<IRabbitMqConnection>().Use(_rabbitConn); }); MessagingSystem.Control.Shutdown(); }
public void setup() { _messagingBase = Substitute.For<IMessagingBase>(); _sleeper = Substitute.For<ISleepWrapper>(); _dispatcher = Substitute.For<IDispatch<byte[]>>(); _dispatcherFactory = Substitute.For<IDispatcherFactory>(); _dispatcherFactory.Create(Arg.Any<IWorkQueue<byte[]>>(), Arg.Any<IWorkerPool<byte[]>>()).Returns(_dispatcher); _queueFactory = Substitute.For<IOutgoingQueueFactory>(); _eventHook1 = Substitute.For<IEventHook>(); _eventHook2 = Substitute.For<IEventHook>(); ObjectFactory.Configure(map => { map.For<IEventHook>().Use(_eventHook1); map.For<IEventHook>().Use(_eventHook2); }); _subject = new SenderNode(_messagingBase, _dispatcherFactory, _sleeper,_queueFactory); }
public void SetUp() { node_factory = MessagingSystem.Receiver(); senderNode = MessagingSystem.Sender(); }