public void Dispose_ClosesOutputStreamIfWritingToStream() { MemoryStream stream = new MemoryStream(); WktWriter target = new WktWriter(stream, new WktWriterSettings()); target.Dispose(); Assert.False(stream.CanRead); }
public void Dispose_ClosesOutputStreamIfWritingToFiles() { string filename = "TestFiles\\wktwriter-closes-output-filestream-test.wkt"; File.Delete(filename); WktWriterSettings settings = new WktWriterSettings(); WktWriter target = new WktWriter(filename, settings); target.Dispose(); FileStream testStream = null; Assert.DoesNotThrow(() => testStream = new FileStream(filename, FileMode.Open, FileAccess.ReadWrite)); testStream.Dispose(); }