Exemplo n.º 1
0
 public void SetUp()
 {
     _receiver       = A.Fake <IServiceBusMessageReceiver>();
     _factory        = A.Fake <IReceiverClientFactory>();
     _receiverClient = A.Fake <IReceiverClient>();
     A.CallTo(() => _factory.Create())
     .Returns(_receiverClient);
     _sut = new GenericServiceBusCommunicationListener(null, _factory, _receiver);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a new instance, using the init parameters of a <see cref="StatefulService"/>
 /// Uses external clientFactory to use msi or middleware
 /// </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="receiver">A handler for incoming messages</param>
 public GenericServiceBusCommunicationListener(
     ServiceContext context,
     IReceiverClientFactory clientFactory,
     IServiceBusMessageReceiver receiver) :
     base(context)
 {
     _clientFactory = clientFactory ?? throw new ArgumentNullException(nameof(clientFactory));
     _receiver      = receiver ?? throw new ArgumentNullException(nameof(receiver));
 }