Esempio n. 1
0
 /// <summary>
 /// Uses ext
 /// </summary>
 /// <param name="context">(Optional) The context that was used to init the Reliable Service that uses this listener.</param>
 /// <param name="clientFactory">A factory to create either QueueClient or SubscriptionClient to listen for messages</param>
 /// <param name="receiverFactory">A factory to create handler for incoming messages</param>
 public GenericServiceBusCommunicationListener(
     ServiceContext context,
     IReceiverClientFactory clientFactory,
     IServiceBusMessageHandlerFactory receiverFactory
     ) :
     base(context)
 {
     _clientFactory = clientFactory ?? throw new ArgumentNullException(nameof(clientFactory));
     _receiver      = receiverFactory?.Create(this) ?? throw new ArgumentNullException(nameof(receiverFactory));
 }
Esempio n. 2
0
 public void SetUp()
 {
     _handlerFactory = A.Fake <IServiceBusMessageHandlerFactory>();
     _receiver       = A.Fake <IServiceBusMessageReceiver>();
     A.CallTo(() => _handlerFactory.Create(A <IServiceBusCommunicationListener> ._))
     .Returns(_receiver);
     _factory        = A.Fake <IReceiverClientFactory>();
     _receiverClient = A.Fake <IReceiverClient>();
     A.CallTo(() => _factory.Create())
     .Returns(_receiverClient);
     _sut = new GenericServiceBusCommunicationListener(null, _factory, _handlerFactory);
 }