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); } }
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)); }
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(); }
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(); }
public string ToWktString(WktWriterSettings settings) { return(new WktWriter(settings).Write(this)); }
public Spatial4nWriter() { _wktWriterSettings = WktWriterSettings.NtsCompatible; _wktWriterSettings.MaxDimesions = 2; }
public void Constructor__SetsDefaultValues() { WktWriterSettings target = new WktWriterSettings(); Assert.False(target.IsReadOnly); }