Ejemplo n.º 1
0
        MqQueueFactory CreateQueueFactory(string namePrefix = null)
        {
            var connProvider = new DefaultMqConnectionProvider(TestMqTools.Load());

            return(new MqQueueFactory(new DefaultMqChannelProvider(connProvider))
            {
                Prefix = namePrefix,
                AutoDelete = true
            });
        }
Ejemplo n.º 2
0
        MqExchangeFactory CreateExchangeFactory(string namePrefix = null)
        {
            var connProvider = new DefaultMqConnectionProvider(TestMqTools.Load());
            var chProvider   = new DefaultMqChannelProvider(connProvider);

            return(new MqExchangeFactory(MqExchangeType.Fanout, chProvider)
            {
                Prefix = namePrefix,
                AutoDelete = true
            });
        }
Ejemplo n.º 3
0
        public void ShouldFailIfExchangeNotExists()
        {
            //Arrange
            var exchangeName = Guid.NewGuid().ToString("N");
            var connProvider = new DefaultMqConnectionProvider(TestMqTools.Load());
            var chProvider   = new DefaultMqChannelProvider(connProvider);
            var exchange     = new MqExchange(exchangeName, chProvider);

            //Act
            var exists = exchange.IsExists();

            //Assert
            Assert.False(exists);
        }
Ejemplo n.º 4
0
 static void Init()
 {
     _connProvider = new DefaultMqConnectionProvider(Load());
     _chProvider   = new DefaultMqChannelProvider(ConnectionProvider);
 }