public void Dispose_ClosesOutputStreamIfWritingToStream()
        {
            MemoryStream stream = new MemoryStream();

            var target = new GpxWriter(stream, new GpxWriterSettings());
            target.Dispose();

            Assert.False(stream.CanRead);
        }
        public void Dispose_ClosesOutputStreamIfWritingToFiles()
        {
            string path = "TestFiles\\gpxwriter-closes-output-filestream-test.osm";
            File.Delete(path);

            var target = new GpxWriter(path, new GpxWriterSettings());
            target.Dispose();

            FileStream testStream = null;
            Assert.DoesNotThrow(() => testStream = new FileStream(path, FileMode.Open, FileAccess.ReadWrite));
            testStream.Dispose();
        }