public ServiceBusTopicPostman(string topic, string need, string messageBody, IServiceBusPostman nextPostman) :
     this(ServiceBusTopic.Client(topic), messageBody.AsServiceBusMessage(new []
 {
     new UserProperty(new NeedUserPropertyName(), need)
 }), nextPostman)
 {
 }
示例#2
0
 private ServiceBusQueuePostman(IQueueClient queueClient, string messageBody, Message message, IServiceBusPostman nextPostman)
 {
     _queueClient = queueClient;
     _messageBody = messageBody;
     _message     = message;
     _nextPostman = nextPostman;
 }
        public async Task GivenPostmanChainThatShouldNotAllExecute_WhenAskingToSend_ThenItShouldExecuteCorrectPostmen()
        {
            // arrange
            Privateer          privateer       = new Privateer();
            FakePostman        nextFakePostman = new FakePostman(true);
            FakePostman        fakePostman     = new FakePostman(false, nextFakePostman);
            IServiceBusPostman postman         = privateer.Object <ServiceBusPostmen>(fakePostman);

            // act
            async Task func() => await postman.SendAsync();

            await func();

            // assert
            fakePostman.CallCount.Should().Be(0);
            nextFakePostman.CallCount.Should().Be(1);
        }
示例#4
0
 public FakePostman(bool shouldExecute, IServiceBusPostman nextPostman)
 {
     _shouldExecute = shouldExecute;
     _nextPostman   = nextPostman;
 }
示例#5
0
 private ServiceBusPostmen(IServiceBusPostman postman) => _postman = postman;
 private ServiceBusTopicPostman(ITopicClient topicClient, Message message, IServiceBusPostman nextPostman)
 {
     _topicClient = topicClient;
     _message     = message;
     _nextPostman = nextPostman;
 }
示例#7
0
 protected ServiceBusMessage(IServiceBusPostman postman) => _serviceBusPostman = postman;
示例#8
0
 public ServiceBusQueuePostman(string messageBody, IServiceBusPostman nextPostman) : this(EnrichedMessagesQueue.Client, messageBody, messageBody.AsServiceBusMessage(), nextPostman)
 {
 }