Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of <see cref="IPublisherCache"/>
        /// </summary>
        /// <param name="name">A name that can be used to identify the router as a node on a distributed network</param>
        /// <param name="senderCache"></param>
        /// <param name="monitorCache"></param>
        /// <param name="receiverCache"></param>
        /// <param name="publisherCache"></param>
        /// <param name="subscriberCache"></param>
        public Router(
            string name,
            ISenderCache senderCache,
            IMonitorCache monitorCache,
            IReceiverCache receiverCache,
            IPublisherCache publisherCache,
            ISubscriberCache subscriberCache)
        {
            if (String.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentNullException(nameof(name));
            }

            this.senderCache     = senderCache ?? throw new ArgumentNullException(nameof(senderCache));
            this.monitorCache    = monitorCache ?? throw new ArgumentNullException(nameof(monitorCache));
            this.receiverCache   = receiverCache ?? throw new ArgumentNullException(nameof(receiverCache));
            this.publisherCache  = publisherCache ?? throw new ArgumentNullException(nameof(publisherCache));
            this.subscriberCache = subscriberCache ?? throw new ArgumentNullException(nameof(subscriberCache));

            routerInfo = new RouterInfo
            {
                Name             = name,
                Running          = false,
                StartedTimestamp = null,
                StoppedTimestamp = null
            };
        }
Esempio n. 2
0
 public void Setup()
 {
     senderCache     = mockSenderCache.Object;
     monitorCache    = mockMonitorCache.Object;
     receiverCache   = mockReceiverCache.Object;
     publisherCache  = mockPublisherCache.Object;
     subscriberCache = mockSubscriberCache.Object;
 }