Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of <see cref="TransportFactory{TSender, TReceiver, TPublisher, TSubscriber}"/>
 /// </summary>
 /// <param name="senderMonitor">Monitor that <see cref="TSender"/>s will be added to</param>
 /// <param name="receiverMonitor">Monitor that <see cref="TReceiver"/>s will be added to</param>
 public TransportFactory(
     ISenderMonitor <TSender> senderMonitor,
     IReceiverMonitor <TReceiver> receiverMonitor,
     IPublisherMonitor <TPublisher> publisherMonitor,
     ISubscriberMonitor <TSubscriber> subscriberMonitor)
 {
     this.senderMonitor     = senderMonitor;
     this.receiverMonitor   = receiverMonitor;
     this.publisherMonitor  = publisherMonitor;
     this.subscriberMonitor = subscriberMonitor;
 }
Esempio n. 2
0
        public void Setup()
        {
            monitorCache    = mockMonitorCache.Object;
            receiverFactory = mockReceiverFactory.Object;
            receiver        = mockReceiver.Object;
            address         = mockAddress.Object;
            receiverMonitor = mockReceiverMonitor.Object;

            mockReceiverFactory
            .Setup(m => m.CreateReceiver(It.IsAny <IAddress>()))
            .Returns(receiver);

            mockReceiverFactory
            .SetupGet(m => m.ReceiverType)
            .Returns(typeof(IReceiver));

            mockReceiverFactory
            .SetupGet(m => m.ReceiverMonitor)
            .Returns(receiverMonitor);
        }