public void ReceiveAfterDispose()
        {
            using (mocks.Ordered)
            {
                SetDisposeExpectations();
            }

            testFileRemoteReceiver.Dispose();
            ObjectDisposedException e = Assert.Throws <ObjectDisposedException>(delegate
            {
                testFileRemoteReceiver.Receive();
            });

            mocks.VerifyAllExpectationsHaveBeenMet();
            Assert.AreEqual(e.ObjectName, "FileRemoteReceiver");
        }
        //------------------------------------------------------------------------------
        //
        // Method: Disconnect
        //
        //------------------------------------------------------------------------------
        /// <summary>
        /// Disconnects and cleans up the underlying MethodInvocationRemoting components.
        /// </summary>
        public void Disconnect()
        {
            methodInvocationReceiver.CancelReceive();
            incomingReceiver.CancelReceive();
            outgoingReceiver.CancelReceive();

            // Call dispose on the sender and receiver objects
            incomingReceiver.Dispose();
            incomingSender.Dispose();
            outgoingReceiver.Dispose();
            outgoingSender.Dispose();
        }