Example #1
0
        public async Task Bind_WithChainedErrorPolicy_RetriedAndMoved()
        {
            _testSubscriber.MustFailCount = 3;
            _connector.Bind(TestEndpoint.GetDefault(), _errorPolicyBuilder.Chain(
                                _errorPolicyBuilder.Retry().MaxFailedAttempts(1),
                                _errorPolicyBuilder.Move(new TestEndpoint("bad"))));
            _broker.Connect();

            var consumer = _broker.Consumers.First();
            await consumer.TestPush(new TestEventOne { Content = "Test", Id = Guid.NewGuid() });

            var producer = (TestProducer)_broker.GetProducer(new TestEndpoint("bad"));

            _testSubscriber.FailCount.Should().Be(2);
            _testSubscriber.ReceivedMessages.Count.Should().Be(2);
            producer.ProducedMessages.Count.Should().Be(1);
        }
Example #2
0
        public void GetProducer_SomeEndpoint_ProducerIsReturned()
        {
            var producer = _broker.GetProducer(TestEndpoint.GetDefault());

            producer.Should().NotBeNull();
        }
Example #3
0
        public void GetProducer_ReturnInstance()
        {
            var producer = _broker.GetProducer(TestEndpoint.Default);

            producer.Should().NotBeNull();
        }