public void The_same_producer_can_be_accessed_on_two_different_threads_give_trat_the_transaction_scopes_do_not_collide() { var producer = new XmsProducer(address, true); using (var scope = new TransactionScope(TransactionScopeOption.Required)) { producer.SendTestMessage(address); scope.Complete(); } var aaa = Task.Run(() => { using (var scope2 = new TransactionScope(TransactionScopeOption.Required)) { producer.SendTestMessage(address); scope2.Complete(); } }); aaa.Wait(); var after = XmsUtilities.GetCurrentQueueDebth(address); Assert.That(after, Is.EqualTo(2)); }
public void GIVEN_non_transactional_pool_WHEN_send_THEN_message_is_enqueued() { using (var producer = new XmsProducer(address, false)) producer.SendTestMessage(address); IBM.XMS.IMessage message; using (var pool = new Pool<XmsPooledConsumer>(2, p => new XmsPooledConsumer(p, new XmsConsumer(address, false)), store)) using (var producer = pool.Acquire()) { message = producer.ReceiveNoWait(); } Assert.That(message,Is.Not.Null); }