public override void Close() { ReadNewSendData(); ReadNewReceiveData(); if (expectedOutput.Size > 0) { throw new Exception("More output data expected. (Size = " + expectedOutput.Size.ToString() + ", SimulationName = '" + simulationName + "')"); } if (InputBuffer.Size > 0) { throw new Exception("Still data to read. (Size = " + mInputBuffer.Size.ToString() + ", SimulationName = '" + simulationName + "')"); } receiveDataReader.Close(); receiveDataReader = null; sendDataReader.Close(); sendDataReader = null; base.Close(); }