public void CreateAll_HasConfig_ReturnAdapters()
        {
            var configuration = new ConfigurationBuilder().AddJsonFile("appsettingsAll.json", true)
                                .Build();

            var constructor = new RabbitMqQueueMessageAdapterConstructor(configuration);

            var adapters = constructor.CreateAll(false);

            Assert.Multiple(() =>
            {
                Assert.That(adapters, Is.Not.Null);
                Assert.That(adapters.Count, Is.EqualTo(2));
                Assert.That(adapters.First().Configuration, Is.Not.Null);
                Assert.That(adapters.First().Configuration.Id, Is.EqualTo(QueueId));
                Assert.That(adapters.Last().Configuration, Is.Not.Null);
                Assert.That(adapters.Last().Configuration.Id, Is.EqualTo("NextRabbit"));
            });
        }
        public void CreateAll_HasConfig_ReturnAdapters()
        {
            var fakeAdvancedBusFactory = new Mock <IAdvancedBusFactory>();
            var configuration          = new ConfigurationBuilder().AddJsonFile("appsettingsAll.json", true)
                                         .Build();

            var constructor = new RabbitMqQueueMessageAdapterConstructor(fakeAdvancedBusFactory.Object, configuration, Given.FakeLoggerFactory);

            var adapters = constructor.CreateAll();

            Assert.Multiple(() =>
            {
                Assert.That(adapters, Is.Not.Null);
                Assert.That(adapters.Count, Is.EqualTo(2));
                Assert.That(adapters.First().Configuration, Is.Not.Null);
                Assert.That(adapters.First().Configuration.Id, Is.EqualTo(QueueId));
                Assert.That(adapters.Last().Configuration, Is.Not.Null);
                Assert.That(adapters.Last().Configuration.Id, Is.EqualTo("NextRabbit"));
            });
        }
Esempio n. 3
0
 public void CreateAll_HasNoServerQueueInConfig_Exception()
 {
     Assert.Throws <ArgumentNullException>(() => _constructor.CreateAll(),
                                           "Value cannot be null. (Parameter 'Server')");
 }