Exemplo n.º 1
0
        public void TestResourceHolder()
        {
            var h1 = new RabbitResourceHolder();
            var h2 = new RabbitResourceHolder();
            var connectionFactory = new Mock <IConnectionFactory>();

            TransactionSynchronizationManager.SetActualTransactionActive(true);
            ConnectionFactoryUtils.BindResourceToTransaction(h1, connectionFactory.Object, true);
            Assert.Same(h1, ConnectionFactoryUtils.BindResourceToTransaction(h2, connectionFactory.Object, true));
            TransactionSynchronizationManager.Clear();
        }