示例#1
0
        public void SidewallCore131Validator_AddToStore_Error_486_SidewallCore_Data_Object_Types_Dont_Match()
        {
            AddParents();

            var xmlIn = string.Format(BasicXMLTemplate, SidewallCore.UidWell, SidewallCore.UidWellbore, SidewallCore.Uid,

                                      string.Empty);

            var response = DevKit.AddToStore(ObjectTypes.Well, xmlIn, null, null);

            Assert.AreEqual((short)ErrorCodes.DataObjectTypesDontMatch, response.Result);
        }
示例#2
0
        public void WitsmlValidator_AddToStore_Error_486_Data_Object_Types_Dont_Match()
        {
            var wells = new WellList {
                Well = DevKit.List(Well)
            };

            var xmlIn    = EnergisticsConverter.ObjectToXml(wells);
            var response = DevKit.AddToStore(ObjectTypes.Wellbore, xmlIn, null, null);

            Assert.IsNotNull(response);
            Assert.AreEqual((short)ErrorCodes.DataObjectTypesDontMatch, response.Result);
        }
        public void Trajectory131Validator_AddToStore_Error_486_Data_Object_Types_Dont_Match()
        {
            AddParents();

            var trajectories = new TrajectoryList {
                Trajectory = DevKit.List(Trajectory)
            };
            var xmlIn    = EnergisticsConverter.ObjectToXml(trajectories);
            var response = DevKit.AddToStore(ObjectTypes.Log, xmlIn, null, null);

            Assert.IsNotNull(response);
            Assert.AreEqual((short)ErrorCodes.DataObjectTypesDontMatch, response.Result);
        }
示例#4
0
        public void Target141Validator_AddToStore_Error_479_Target_Cannot_Decompress_XmlIn()
        {
            AddParents();

            var uncompressedXml = "abcd1234";
            var compressedXml = uncompressedXml;

            var optionsIn = string.Empty;
            ClientCompression.Compress(ref compressedXml, ref optionsIn);

            var response = DevKit.AddToStore(ObjectTypes.Target, uncompressedXml, null, optionsIn);
            Assert.AreEqual((short)ErrorCodes.CannotDecompressQuery, response.Result);
        }
示例#5
0
        public void Target141Validator_AddToStore_Error_426_Target_Compressed_XmlIn_Must_Conform_To_Schema()
        {
            AddParents();

            var nonConformingXml = string.Format(BasicXMLTemplate, Target.UidWell, Target.UidWellbore, Target.Uid,
                $"<name>{Target.Name}</name><name>{Target.Name}</name>");

            var optionsIn = string.Empty;
            ClientCompression.Compress(ref nonConformingXml, ref optionsIn);

            var response = DevKit.AddToStore(ObjectTypes.Target, nonConformingXml, null, optionsIn);
            Assert.AreEqual((short)ErrorCodes.CompressedInputNonConforming, response.Result);
        }
示例#6
0
        public void WitsmlValidator_AddToStore_Error_413_Unsupported_Data_Object()
        {
            // Use an unsupported data schema version
            var wells = new WellList
            {
                Well    = DevKit.List(Well),
                Version = "1.4.x.y"
            };

            var xmlIn    = EnergisticsConverter.ObjectToXml(wells);
            var response = DevKit.AddToStore(ObjectTypes.Well, xmlIn, null, null);

            Assert.IsNotNull(response);
            Assert.AreEqual((short)ErrorCodes.DataObjectNotSupported, response.Result);
        }
示例#7
0
        public void WitsmlValidator_AddToStore_Error_468_Missing_Version_Attribute()
        {
            // Use an unsupported data schema version
            var wells = new WellList
            {
                Well    = DevKit.List(Well),
                Version = null
            };

            var xmlIn    = EnergisticsConverter.ObjectToXml(wells);
            var response = DevKit.AddToStore(ObjectTypes.Well, xmlIn, null, null);

            Assert.IsNotNull(response);
            Assert.AreEqual((short)ErrorCodes.MissingDataSchemaVersion, response.Result);
        }
示例#8
0
        public void DataObjectValidator_AddToStore_Error_453_Missing_Unit_For_Measure_Data()
        {
            var xmlIn = "<wells xmlns=\"http://www.witsml.org/schemas/1series\" version=\"1.4.1.1\">" + Environment.NewLine +
                        "   <well>" + Environment.NewLine +
                        "     <name>Well-to-add-missing-unit</name>" + Environment.NewLine +
                        "     <timeZone>-06:00</timeZone>" + Environment.NewLine +
                        "     <wellheadElevation>1000</wellheadElevation>" + Environment.NewLine +
                        "   </well>" + Environment.NewLine +
                        "</wells>";

            var response = DevKit.AddToStore(ObjectTypes.Well, xmlIn, null, null);

            Assert.IsNotNull(response);
            Assert.AreEqual((short)ErrorCodes.MissingUnitForMeasureData, response.Result);
        }
示例#9
0
        public void WitsmlValidator_AddToStore_Error_487_Data_Object_Not_Supported()
        {
            var entity = new Target {
                Name = "Entity-to-test-unsupported-error"
            };
            var list = new TargetList {
                Target = DevKit.List(entity)
            };

            var xmlIn    = EnergisticsConverter.ObjectToXml(list);
            var response = DevKit.AddToStore("target", xmlIn, null, null);

            Assert.IsNotNull(response);
            Assert.AreEqual((short)ErrorCodes.DataObjectTypeNotSupported, response.Result);
        }
示例#10
0
        public void WitsmlValidator_AddToStore_Error_444_Mulitple_Data_Objects_Error()
        {
            var well1 = new Well {
                Name = DevKit.Name("Well-to-01"), TimeZone = DevKit.TimeZone, Uid = DevKit.Uid()
            };
            var well2 = new Well {
                Name = DevKit.Name("Well-to-02"), TimeZone = DevKit.TimeZone, Uid = DevKit.Uid()
            };
            var wells = new WellList {
                Well = DevKit.List(well1, well2)
            };

            var xmlIn    = EnergisticsConverter.ObjectToXml(wells);
            var response = DevKit.AddToStore(ObjectTypes.Well, xmlIn, null, null);

            Assert.IsNotNull(response);
            Assert.AreEqual((short)ErrorCodes.InputTemplateMultipleDataObjects, response.Result);
        }
示例#11
0
        public void Log141DataAdapter_AddToStore_Supports_NaN_In_Numeric_Fields()
        {
            AddParents();

            // Add log
            var xmlIn = "<?xml version=\"1.0\"?>" + Environment.NewLine +
                        "<logs xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:dc=\"http://purl.org/dc/terms/\" " +
                        "xmlns:gml=\"http://www.opengis.net/gml/3.2\" version=\"1.4.1.1\" xmlns=\"http://www.witsml.org/schemas/1series\">" + Environment.NewLine +
                        "<log uid=\"" + Log.Uid + "\" uidWell=\"" + Log.UidWell + "\" uidWellbore=\"" + Log.UidWellbore + "\">" + Environment.NewLine +
                        "<nameWell>" + Well.Name + "</nameWell>" + Environment.NewLine +
                        "<nameWellbore>" + Wellbore.Name + "</nameWellbore>" + Environment.NewLine +
                        "<name>" + DevKit.Name("Log 01") + "</name>" + Environment.NewLine +
                        "<indexType>measured depth</indexType>" + Environment.NewLine +
                        "<direction>increasing</direction>" + Environment.NewLine +
                        "<bhaRunNumber>NaN</bhaRunNumber>" + Environment.NewLine +
                        "<indexCurve>MD</indexCurve>" + Environment.NewLine +
                        "<logCurveInfo uid=\"MD\">" + Environment.NewLine +
                        "  <mnemonic>MD</mnemonic>" + Environment.NewLine +
                        "  <unit>m</unit>" + Environment.NewLine +
                        "  <classIndex>NaN</classIndex>" + Environment.NewLine +
                        "  <typeLogData>double</typeLogData>" + Environment.NewLine +
                        "</logCurveInfo>" + Environment.NewLine +
                        "<logCurveInfo uid=\"GR\">" + Environment.NewLine +
                        "  <mnemonic>GR</mnemonic>" + Environment.NewLine +
                        "  <unit>gAPI</unit>" + Environment.NewLine +
                        "  <classIndex>NaN</classIndex>" + Environment.NewLine +
                        "  <typeLogData>double</typeLogData>" + Environment.NewLine +
                        "</logCurveInfo>" + Environment.NewLine +
                        "</log>" + Environment.NewLine +
                        "</logs>";

            var response = DevKit.AddToStore(ObjectTypes.Log, xmlIn, null, null);

            Assert.AreEqual((short)ErrorCodes.Success, response.Result);

            var result = GetLog(Log);

            Assert.IsNull(result.BhaRunNumber);
            Assert.AreEqual(2, result.LogCurveInfo.Count);
            Assert.IsNull(result.LogCurveInfo[0].ClassIndex);
            Assert.IsNull(result.LogCurveInfo[1].ClassIndex);
        }
        public void Well141DataAdapter_AddToStore_Can_AddWell_And_Ignore_Invalid_Attribute()
        {
            var wellName = DevKit.Name("Bug-5855-AddToStore-Bad-Attribute");

            string xmlIn = string.Format(DevKit141Aspect.BasicAddWellXmlTemplate, null, wellName, "<field abc=\"cde\">Big Field</field>");

            var response = DevKit.AddToStore(ObjectTypes.Well, xmlIn, null, null);

            Assert.IsNotNull(response);
            Assert.AreEqual((short)ErrorCodes.Success, response.Result);

            // Query
            var query = new Well {
                Uid = response.SuppMsgOut
            };
            var result = DevKit.Query <WellList, Well>(query, ObjectTypes.Well, null, optionsIn: OptionsIn.ReturnElements.All);

            Assert.AreEqual(1, result.Count);
            Assert.AreEqual("Big Field", result[0].Field);
        }
        public void Trajectory131Validator_AddToStore_Error_443_Uom_Not_Valid()
        {
            AddParents();

            var xmlIn = "<trajectorys xmlns=\"http://www.witsml.org/schemas/131\" version=\"1.3.1.1\">" + Environment.NewLine +
                        "<trajectory uid=\"" + Trajectory.Uid + "\" uidWell=\"" + Trajectory.UidWell + "\" uidWellbore=\"" + Trajectory.UidWellbore + "\">" + Environment.NewLine +
                        "<nameWell>" + Trajectory.NameWell + "</nameWell>" + Environment.NewLine +
                        "<nameWellbore>" + Trajectory.NameWellbore + "</nameWellbore>" + Environment.NewLine +
                        "<name>" + Trajectory.Name + "</name>" + Environment.NewLine +
                        "<trajectoryStation uid=\"ts01\">" + Environment.NewLine +
                        "<typeTrajStation>unknown</typeTrajStation>" + Environment.NewLine +
                        "<md uom=\"dega\">5673.5</md>" + Environment.NewLine +
                        "<tvd uom=\"ft\">5432.8</tvd>" + Environment.NewLine +
                        "<incl uom=\"dega\">12.4</incl>" + Environment.NewLine +
                        "<azi uom=\"dega\">47.3</azi>" + Environment.NewLine +
                        "</trajectoryStation>" + Environment.NewLine +
                        "</trajectory>" + Environment.NewLine +
                        "</trajectorys>";

            var response = DevKit.AddToStore(ObjectTypes.Trajectory, xmlIn, null, null);

            Assert.IsNotNull(response);
            Assert.AreEqual((short)ErrorCodes.InvalidUnitOfMeasure, response.Result);
        }
        public void FormationMarker141Validator_AddToStore_Error_401_No_Plural_Root_Element()
        {
            var response = DevKit.AddToStore(ObjectTypes.FormationMarker, QueryInvalidPluralRoot, null, null);

            Assert.AreEqual((short)ErrorCodes.MissingPluralRootElement, response?.Result);
        }
示例#15
0
        public void SurveyProgram131Validator_AddToStore_Error_401_No_Plural_Root_Element()
        {
            var response = DevKit.AddToStore(ObjectTypes.SurveyProgram, QueryInvalidPluralRoot, null, null);

            Assert.AreEqual((short)ErrorCodes.MissingPluralRootElement, response?.Result);
        }