private void dispose(Boolean disposing) { if (IsDisposed) { return; } if (disposing) // Do deterministic finalization of managed resources { if (_baseTable != null) { _baseTable.Dispose(); } _baseTable = null; if (_reader != null) { _reader.Dispose(); } _reader = null; if (_writer != null) { _writer.Dispose(); } _writer = null; } _isOpen = false; }
public void ReadEntry_TryReadAfterDisposed_ShouldThrowException() { // Arrange m_TmpFile = new TempFileWriter("data.dbf", DbfFiles.Read("point_ed50_geo")); m_Reader = new DbaseReader(m_TmpFile.Path); m_Reader.Dispose(); // Act. m_Reader.ReadEntry(1); }
public void TestCleanup() { if (m_Reader != null) { m_Reader.Dispose(); m_Reader = null; } if (m_TmpFile != null) { m_TmpFile.Dispose(); m_TmpFile = null; } }
public void ReadEntry_TryReadAfterDisposed_ShouldThrowException() { // Arrange m_TmpFile = new TempFileWriter(".dbf", DbfFiles.Read("point_ed50_geo")); m_Reader = new DbaseReader(m_TmpFile.Path); m_Reader.Dispose(); // Act. Assert.Catch <InvalidOperationException>(() => { m_Reader.ReadEntry(1); }); }
public void ReadEntry_TryReadAfterDisposed_ShouldThrowException() { // Arrange m_TmpFile = new TempFileWriter("data.dbf", DbfFiles.Read("point_ed50_geo")); m_Reader = new DbaseReader(m_TmpFile.Path); m_Reader.Dispose(); // Act. m_Reader.ReadEntry(1); }