示例#1
0
        public void GeneratorNameSetter_ThrowInvaldOperationExceptionIfSettingsIsReadOnly()
        {
            var target = new GpxWriterSettings();

            target.IsReadOnly = true;

            Assert.Throws <InvalidOperationException>(() => target.GeneratorName = "TEST");
        }
示例#2
0
        public void WriteMetadataSetter_ThrowInvaldOperationExceptionIfSettingsIsReadOnly()
        {
            var target = new GpxWriterSettings();

            target.IsReadOnly = true;

            Assert.Throws <InvalidOperationException>(() => target.WriteMetadata = true);
        }
示例#3
0
        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);
            }
        }
示例#4
0
        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);
            }
        }
示例#5
0
        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);
            }
        }
示例#6
0
        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));
        }
示例#7
0
        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));
        }
示例#8
0
        public void Constructor__CreatesSettingsWithDefaultValues()
        {
            var target = new GpxWriterSettings();

            Assert.Equal(true, target.WriteMetadata);
        }