Esempio n. 1
0
        public FubuTransportSystem(ApplicationSettings settings) : base(settings)
        {
            FubuTransport.SetupForTesting(); // Uses FubuMode.SetUpTestingMode();

            AddContextualProvider <MessageContextualInfoProvider>();

            OnStartup <IMessagingSession>(x => Bottles.Services.Messaging.EventAggregator.Messaging.AddListener(x));

            // Clean up all the existing queue state to prevent test pollution
            OnContextCreation <TransportCleanup>(cleanup => {
                cleanup.ClearAll();

                RemoteSubSystems.Each(x => x.Runner.SendRemotely(new ClearAllTransports()));
            });

            OnContextCreation <IMessagingSession>(
                x => RemoteSubSystems.Each(sys => sys.Runner.Messaging.AddListener(x)));

            OnContextCreation(TestNodes.Reset);
        }