Example #1
0
        public void WitsmlParser_RemoveNaNElements_Removes_NaN_Elements()
        {
            string wellXml = "<wells xmlns=\"http://www.witsml.org/schemas/1series\" version=\"1.4.1.1\">" + Environment.NewLine +
                             "<well>" + Environment.NewLine +
                             "<name>Test Full Well</name>" + Environment.NewLine +
                             "<pcInterest uom=\"%\">NaN</pcInterest>" + Environment.NewLine +
                             "</well>" + Environment.NewLine +
                             "</wells>";

            var document = WitsmlParser.Parse(wellXml);
            var result   = WitsmlParser.RemoveNaNElements <WellList>(document.Root);
            var welllist = EnergisticsConverter.XmlToObject <WellList>(result);

            Assert.IsNull(welllist.Well[0].PercentInterest);
        }
Example #2
0
        public void WitsmlParser_RemoveNaNElements_Removes_Nested_NaN_Elements()
        {
            string wellXml = "<wells xmlns=\"http://www.witsml.org/schemas/1series\" version=\"1.4.1.1\">" + Environment.NewLine +
                             "<well>" + Environment.NewLine +
                             "<name>Test Full Well</name>" + Environment.NewLine +
                             "<wellDatum uid=\"KB\">" + Environment.NewLine +
                             "    <name>Kelly Bushing</name>" + Environment.NewLine +
                             "    <code>KB</code>" + Environment.NewLine +
                             "    <elevation uom=\"ft\" datum=\"SL\">NaN</elevation>" + Environment.NewLine +
                             "</wellDatum>" + Environment.NewLine +
                             "</well>" + Environment.NewLine +
                             "</wells>";

            var document = WitsmlParser.Parse(wellXml);
            var result   = WitsmlParser.RemoveNaNElements <WellList>(document.Root);
            var welllist = EnergisticsConverter.XmlToObject <WellList>(result);

            Assert.IsNull(welllist.Well[0].WellDatum[0].Elevation);
        }