Ejemplo n.º 1
0
            public void should_set_queue_ttl()
            {
                const string ProducerConfig =
                    @"<endpoints>
                            <endpoint name=""producer"" connectionString=""amqp://localhost/integration"" faultQueueTtl=""10:10:00"">
                            </endpoint>
                        </endpoints>";

                Mock <IDependencyResolver> dependencyResoverMock = new Mock <IDependencyResolver>();
                var busConfigurator = new BusConfiguration();

                var section = new XmlEndpointsSection(ProducerConfig);
                var sut     = new AppConfigConfigurator(section, dependencyResoverMock.Object);
                var result  = sut.Configure("producer", busConfigurator);

                ReceiverOptions receiverOptions = ((BusConfiguration)result).ReceiverDefaults;

                Assert.IsTrue(receiverOptions.GetFaultQueueTtl().HasValue, "Должно быть установлено время хранения сообщений.");
                Assert.AreEqual(TimeSpan.Parse("10:10:00"), receiverOptions.GetFaultQueueTtl().Value, "Должно быть устрановлено корректное время хранения.");
            }
Ejemplo n.º 2
0
            public void should_not_be_set_by_default()
            {
                const string ProducerConfig =
                    @"<endpoints>
                            <endpoint name=""producer"" connectionString=""amqp://localhost/integration"">
                            </endpoint>
                        </endpoints>";

                Mock <IDependencyResolver> dependencyResoverMock = new Mock <IDependencyResolver>();
                var busConfigurator = new BusConfiguration();

                var section = new XmlEndpointsSection(ProducerConfig);
                var sut     = new AppConfigConfigurator(section, dependencyResoverMock.Object);
                var result  = sut.Configure("producer", busConfigurator);

                ReceiverOptions receiverOptions = ((BusConfiguration)result).ReceiverDefaults;

                Assert.IsFalse(receiverOptions.GetFaultQueueTtl().HasValue, "Не должно быть установлено время хранения сообщений.");
            }