Пример #1
0
        public void DisposeTest()
        {
            var messageSender = new MessageSender(_adapter.Object, _callContextFactory.Object, "ReApplication");

            messageSender.Dispose();
            _adapter.Verify(x => x.Dispose(), Times.AtLeastOnce);
        }
Пример #2
0
        public void Dispose()
        {
            cancellationTokenSource.Cancel();
            shutdownLatch.Set();

            pofDispatcher.Dispose();
            messageSender.Dispose();
        }
Пример #3
0
        public void Dispose_Call_ShouldDisposeAdapter()
        {
            Mock <IMessageAdapter> adapterMock = null;
            var adapter = Given.MessageAdapter
                          .Please(m => adapterMock = m);

            var messageSender = new MessageSender(adapter, Given.CallContextFactory, "ReApplication");

            messageSender.Dispose();

            adapterMock.Verify(x => x.Dispose());
        }
        //[Test] not hangs the unit tests due to threads
        //note the ability for this to function internally depends on what type of connection is created
        public void RoundTrip()
        {
            var transmitter = new MessageSender(m_Context);
            var receiver = new MessageReceiver(m_Context);
            receiver.CreateReceiveSocket();

            string message = "Hello world";
            //transmitter.Connect();
            transmitter.Send(message);

            string recieved = receiver.Receive();

            Assert.AreEqual(message, recieved);
            receiver.Dispose();
            transmitter.Dispose();
        }
        //[Test] not hangs the unit tests due to threads
        //note the ability for this to function internally depends on what type of connection is created
        public void RoundTrip()
        {
            var transmitter = new MessageSender(m_Context);
            var receiver    = new MessageReceiver(m_Context);

            receiver.CreateReceiveSocket();

            string message = "Hello world";

            //transmitter.Connect();
            transmitter.Send(message);

            string recieved = receiver.Receive();

            Assert.AreEqual(message, recieved);
            receiver.Dispose();
            transmitter.Dispose();
        }
        void Dispose(bool managed)
        {
            if (!managed || _disposed)
            {
                return;
            }

            try
            {
                Disconnect();

                if (_messageSender != null)
                {
                    _messageSender.Dispose();
                }
            }
            finally
            {
                _disposed = true;
            }
        }
 public void DisposesCleanly()
 {
     var transmitter = new MessageSender(m_Context);
     transmitter.Dispose();
 }
Пример #8
0
 public void Dispose()
 {
     messageSender.Dispose();
     pofDispatcher.Dispose();
     clusteringPhaseManager.Dispose();
 }
        public void DisposesCleanly()
        {
            var transmitter = new MessageSender(m_Context);

            transmitter.Dispose();
        }