public void GeneratorNameSetter_ThrowInvaldOperationExceptionIfSettingsIsReadOnly() { var target = new GpxWriterSettings(); target.IsReadOnly = true; Assert.Throws <InvalidOperationException>(() => target.GeneratorName = "TEST"); }
public void WriteMetadataSetter_ThrowInvaldOperationExceptionIfSettingsIsReadOnly() { var target = new GpxWriterSettings(); target.IsReadOnly = true; Assert.Throws <InvalidOperationException>(() => target.WriteMetadata = true); }
public void Constructor_StreamSettings_SetsSettingsAndMarkSettingsAsReadOnly() { var stream = new MemoryStream(); var settings = new GpxWriterSettings(); using (var target = new GpxWriter(stream, settings)) { Assert.Same(settings, target.Settings); Assert.True(target.Settings.IsReadOnly); } }
public void Constructor_PathSettings_SetsSettingsAndMakesThemReadOnly() { string path = "TestFiles\\gpxwriter-constructor-test.gpx"; var settings = new GpxWriterSettings(); using (var target = new GpxWriter(path, settings)) { Assert.Same(settings, target.Settings); Assert.True(target.Settings.IsReadOnly); } }
public void Constructor_PathSettings_SetsSettingsAndMakesThemReadOnly() { string path = PathHelper.GetTempFilePath("gpxwriter-constructor-test-1.gpx"); var settings = new GpxWriterSettings(); using (var target = new GpxWriter(path, settings)) { Assert.Same(settings, target.Settings); Assert.True(target.Settings.IsReadOnly); } }
public void Constructor_PathSettings_CreatesOutputFile() { string filename = PathHelper.GetTempFilePath("gpxwriter-constructor-creates-output-test.gpx"); var settings = new GpxWriterSettings(); using (var target = new GpxWriter(filename, settings)) { ; } Assert.True(File.Exists(filename)); }
public void Constructor_PathSettings_CreatesOutputFile() { string filename = "TestFiles\\gpxwriter-constructor-creates-output-test.gpx"; File.Delete(filename); var settings = new GpxWriterSettings(); using (var target = new GpxWriter(filename, settings)) { ; } Assert.True(File.Exists(filename)); }
public void Constructor__CreatesSettingsWithDefaultValues() { var target = new GpxWriterSettings(); Assert.Equal(true, target.WriteMetadata); }