Exemplo n.º 1
0
        public void ParseISOMetadata()
        {
            var xmlPath = @"TestFiles\v11\GetValues_Mendon_usu3.xml";
            var target  = new WaterML11Parser();

            var result = target.ParseGetValues(xmlPath);
            var series = result[0];

            var isoMetadata = series.Source.ISOMetadata;

            Assert.AreEqual("inlandWaters", isoMetadata.TopicCategory);
            Assert.AreEqual("Little Bear River Conservation Effects Assessment Project water quality data.", isoMetadata.Title);
            Assert.AreEqual("Abstract", isoMetadata.Abstract);
            Assert.AreEqual("ProfileVersion", isoMetadata.ProfileVersion);
            Assert.AreEqual("MetadataLink", isoMetadata.MetadataLink);
        }
Exemplo n.º 2
0
        public void ParseDataValues()
        {
            var xmlPath = @"TestFiles\v11\GetValues_Mendon_usu3.xml";
            var target  = new WaterML11Parser();

            var result = target.ParseGetValues(xmlPath);
            var series = result[0];

            // Check first data value
            var first = series.DataValueList[0];

            Assert.AreEqual(12.91645, first.Value);
            Assert.AreEqual(new DateTime(2005, 08, 05, 07, 00, 00), first.DateTimeUTC);
            Assert.AreEqual(new DateTime(2005, 08, 05, 00, 00, 00), first.LocalDateTime);
            Assert.AreEqual(-7, first.UTCOffset);

            // Check last data value
            var last = series.DataValueList[series.DataValueList.Count - 1];

            Assert.AreEqual(12.95674, last.Value);
            Assert.AreEqual(new DateTime(2005, 08, 06, 07, 00, 00), last.DateTimeUTC);
            Assert.AreEqual(new DateTime(2005, 08, 06, 00, 00, 00), last.LocalDateTime);
            Assert.AreEqual(-7, last.UTCOffset);

            // Check series  BeginDateTime/BeginDateTimeUTC, EndDateTime/EndDateTimeUTC
            var expectedBeginDateTime    = first.LocalDateTime;
            var expectedBeginDateTimeUTC = first.DateTimeUTC;

            var expectedEndDateTime    = last.LocalDateTime;
            var expectedEndDateTimeUTC = last.DateTimeUTC;

            Assert.AreEqual(expectedBeginDateTime, series.BeginDateTime);
            Assert.AreEqual(expectedBeginDateTimeUTC, series.BeginDateTimeUTC);
            Assert.AreEqual(expectedEndDateTime, series.EndDateTime);
            Assert.AreEqual(expectedEndDateTimeUTC, series.EndDateTimeUTC);
        }