Esempio n. 1
0
        public void Dispose_ClosesOutputStreamIfWritingToStream()
        {
            MemoryStream stream = new MemoryStream(PbfTestData.pbf_n_node);
            OsmReaderSettings settings = new OsmReaderSettings() {ReadMetadata = true};

            PbfReader target = new PbfReader(stream, settings);
            target.Dispose();

            Assert.False(stream.CanRead);
        }
Esempio n. 2
0
        public void Dispose_ClosesOutputStreamIfWritingToFiles()
        {
            string filename = "..\\..\\src\\Tests.SpatialLite.Osm\\Data\\Pbf\\pbf-n-node.pbf";
            OsmReaderSettings settings = new OsmReaderSettings() {ReadMetadata = true};

            PbfReader target = new PbfReader(filename, settings);
            target.Dispose();

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