Example #1
0
        public void Construcotor_PathSettings_SetsSettingsAndMakeThemReadOnly()
        {
            WktWriterSettings settings = new WktWriterSettings();

            using (WktWriter target = new WktWriter(new MemoryStream(), settings)) {
                Assert.Same(settings, target.Settings);
                Assert.True(settings.IsReadOnly);
            }
        }
Example #2
0
        public void Constructor_PathSettings_CreatesOutputFile()
        {
            string filename = PathHelper.GetTempFilePath("wktwriter-constructor-creates-output-test.wkt");

            File.Delete(filename);

            WktWriterSettings settings = new WktWriterSettings();

            using (WktWriter target = new WktWriter(filename, settings)) {
                ;
            }

            Assert.True(File.Exists(filename));
        }
Example #3
0
        public void Dispose_ClosesOutputStreamIfWritingToFiles()
        {
            string filename = PathHelper.GetTempFilePath("wktwriter-closes-output-filestream-test.wkt");

            WktWriterSettings settings = new WktWriterSettings();
            WktWriter         target   = new WktWriter(filename, settings);

            target.Dispose();

            FileStream testStream = null;

            testStream = new FileStream(filename, FileMode.Open, FileAccess.ReadWrite);
            testStream.Dispose();
        }
Example #4
0
        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();
        }
Example #5
0
 public string ToWktString(WktWriterSettings settings)
 {
     return(new WktWriter(settings).Write(this));
 }
Example #6
0
 public Spatial4nWriter()
 {
     _wktWriterSettings = WktWriterSettings.NtsCompatible;
     _wktWriterSettings.MaxDimesions = 2;
 }
Example #7
0
        public void Constructor__SetsDefaultValues()
        {
            WktWriterSettings target = new WktWriterSettings();

            Assert.False(target.IsReadOnly);
        }