Example #1
0
        public void DataObjectTemplate_Remove_And_Ignore_Elements_For_Log_141()
        {
            var template = new DataObjectTemplate(new [] { "CommonData", "CustomData" });
            var document = template.Create <Witsml141.LogList>();

            template.Remove(document, "//logCurveInfo", "//logData");

            var xml = document.ToString();

            Console.WriteLine(xml);

            Assert.IsFalse(xml.Contains("logCurveInfo"), "logCurveInfo");
            Assert.IsFalse(xml.Contains("logData"), "logData");
            //Assert.IsFalse(xml.Contains("commonData"), "commonData");
            //Assert.IsFalse(xml.Contains("customData"), "customData");
        }
        public void DataObjectTemplate_Remove_And_Set_Element_Values_For_Log_141()
        {
            var template = new DataObjectTemplate(new[] { "CommonData", "CustomData" });
            var document = template.Create <Witsml141.LogList>();

            template
            .Remove(document, "//startDateTimeIndex", "//endDateTimeIndex", "//logCurveInfo/*", "//logCurveInfo/@*", "//logParam")
            .Set(document, "//startIndex", 0.0)
            .Set(document, "//startIndex/@uom", "m")
            .Set(document, "//endIndex", 100.5)
            .Set(document, "//endIndex/@uom", "m");

            var xml = document.ToString();

            Console.WriteLine(xml);

            Assert.IsTrue(xml.Contains("<startIndex uom=\"m\">0</startIndex>"));
            Assert.IsTrue(xml.Contains("<endIndex uom=\"m\">100.5</endIndex>"));
            Assert.IsTrue(xml.Contains("<logCurveInfo />"));
        }