public void Dispose_ClosesOutputStreamIfWritingToStream()
        {
            MemoryStream stream = new MemoryStream(XmlTestData.osm_real_file);

            OsmXmlReader target = new OsmXmlReader(stream, new OsmXmlReaderSettings()
            {
                ReadMetadata = false
            });

            target.Dispose();

            Assert.False(stream.CanRead);
        }
Beispiel #2
0
        public void Dispose_ClosesOutputStreamIfWritingToFiles()
        {
            string filename = "../../../Data/Xml/osm-real-file.osm";

            OsmXmlReader target = new OsmXmlReader(filename, new OsmXmlReaderSettings()
            {
                ReadMetadata = false
            });

            target.Dispose();

            FileStream testStream = null;

            testStream = new FileStream(filename, FileMode.Open, FileAccess.ReadWrite);
            testStream.Dispose();
        }
        public void Dispose_ClosesOutputStreamIfWritingToFiles()
        {
            string filename = "../../src/Tests.SpatialLite.Osm/Data/Xml/osm-real-file.osm";

            OsmXmlReader target = new OsmXmlReader(filename, new OsmXmlReaderSettings()
            {
                ReadMetadata = false
            });

            target.Dispose();

            FileStream testStream = null;

            Assert.DoesNotThrow(() => testStream = new FileStream(filename, FileMode.Open, FileAccess.ReadWrite));
            testStream.Dispose();
        }
        public void Dispose_ClosesOutputStreamIfWritingToFiles()
        {
            string filename = "../../src/Tests.SpatialLite.Osm/Data/Xml/osm-real-file.osm";

            OsmXmlReader target = new OsmXmlReader(filename, new OsmXmlReaderSettings() { ReadMetadata = false });
            target.Dispose();

            FileStream testStream = null;
            Assert.DoesNotThrow(() => testStream = new FileStream(filename, FileMode.Open, FileAccess.ReadWrite));
            testStream.Dispose();
        }
        public void Dispose_ClosesOutputStreamIfWritingToStream()
        {
            MemoryStream stream = new MemoryStream(XmlTestData.osm_real_file);

            OsmXmlReader target = new OsmXmlReader(stream, new OsmXmlReaderSettings() { ReadMetadata = false });
            target.Dispose();

            Assert.False(stream.CanRead);
        }