public void ReadMetadataSetter_ThrowInvaldOperationExceptionIfSettingsIsReadOnly() { var target = new GpxReaderSettings(); target.IsReadOnly = true; Assert.Throws<InvalidOperationException>(() => target.ReadMetadata = true); }
/// <summary> /// Initializes a new instance of the GpxReader class that reads data from the specified stream. /// </summary> /// <param name="stream">The stream with osm xml data.</param> /// <param name="settings">The GpxReaderSettings object that determines behaviour of the reader.</param> public GpxReader(Stream stream, GpxReaderSettings settings) { _input = stream; this.Settings = settings; this.Settings.IsReadOnly = true; this.InitializeReader(); }
public void Constructor_StreamSettings_SetsSettingsAndMakesItReadOnly() { var settings = new GpxReaderSettings() { ReadMetadata = false }; using (var target = new GpxReader(new MemoryStream(GpxTestData.gpx_real_file), settings)) { Assert.Same(settings, target.Settings); Assert.True(settings.IsReadOnly); } }
/// <summary> /// Initializes a new instance of the GpxReader class that reads data from the specified file. /// </summary> /// <param name="path">Path to the .gpx file.</param> /// <param name="settings">The GpxReaderSettings object that determines behaviour of the reader.</param> public GpxReader(string path, GpxReaderSettings settings) { _input = new FileStream(path, FileMode.Open, FileAccess.Read); _ownsInputStream = true; this.Settings = settings; this.Settings.IsReadOnly = true; this.InitializeReader(); }
public void Constructor_StringSettings_SetsSettingsAndMakesItReadOnly() { string path = "../../src/Tests.SpatialLite.Gps/Data/Gpx/gpx-real-file.gpx"; var settings = new GpxReaderSettings() { ReadMetadata = false }; using (var target = new GpxReader(path, settings)) { Assert.Same(settings, target.Settings); Assert.True(settings.IsReadOnly); } }
public void Constructor__CreatesSettingsWithDefaultValues() { var target = new GpxReaderSettings(); Assert.Equal(true, target.ReadMetadata); }