public ServiceBusTopicPostman(string topic, string need, string messageBody, IServiceBusPostman nextPostman) : this(ServiceBusTopic.Client(topic), messageBody.AsServiceBusMessage(new [] { new UserProperty(new NeedUserPropertyName(), need) }), nextPostman) { }
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); }
public FakePostman(bool shouldExecute, IServiceBusPostman nextPostman) { _shouldExecute = shouldExecute; _nextPostman = nextPostman; }
private ServiceBusPostmen(IServiceBusPostman postman) => _postman = postman;
private ServiceBusTopicPostman(ITopicClient topicClient, Message message, IServiceBusPostman nextPostman) { _topicClient = topicClient; _message = message; _nextPostman = nextPostman; }
protected ServiceBusMessage(IServiceBusPostman postman) => _serviceBusPostman = postman;
public ServiceBusQueuePostman(string messageBody, IServiceBusPostman nextPostman) : this(EnrichedMessagesQueue.Client, messageBody, messageBody.AsServiceBusMessage(), nextPostman) { }