public void Rig141DataAdapter_AddToStore_Can_Add_Rig() { AddParents(); DevKit.AddAndAssert <RigList, Rig>(Rig); }
public void Trajectory141DataAdapter_GetFromStore_Filter_ExtensionNameValue() { AddParents(); var extensionName1 = DevKit.ExtensionNameValue("Ext-1", "1.0", "m"); var extensionName2 = DevKit.ExtensionNameValue("Ext-2", "2.0", "cm", PrimitiveType.@float); extensionName2.MeasureClass = MeasureClass.Length; var extensionName3 = DevKit.ExtensionNameValue("Ext-3", "3.0", "cm", PrimitiveType.unknown); Trajectory.CommonData = new CommonData() { ExtensionNameValue = new List <ExtensionNameValue>() { extensionName1, extensionName2, extensionName3 } }; // Add the Trajectory141 DevKit.AddAndAssert(Trajectory); // Query for first extension var commonDataXml = "<commonData>" + Environment.NewLine + "<extensionNameValue uid=\"\">" + Environment.NewLine + "<name />{0}" + Environment.NewLine + "</extensionNameValue>" + Environment.NewLine + "</commonData>"; var extValueQuery = string.Format(commonDataXml, "<dataType>double</dataType>"); var queryXml = string.Format(BasicXMLTemplate, Trajectory.UidWell, Trajectory.UidWellbore, Trajectory.Uid, extValueQuery); var result = DevKit.Query <TrajectoryList, Trajectory>(ObjectTypes.Trajectory, queryXml, null, OptionsIn.ReturnElements.Requested); Assert.IsNotNull(result); Assert.AreEqual(1, result.Count); var resultTrajectory = result[0]; Assert.IsNotNull(resultTrajectory); var commonData = resultTrajectory.CommonData; Assert.IsNotNull(commonData); Assert.AreEqual(1, commonData.ExtensionNameValue.Count); var env = commonData.ExtensionNameValue[0]; Assert.IsNotNull(env); Assert.AreEqual(extensionName1.Uid, env.Uid); Assert.AreEqual(extensionName1.Name, env.Name); // Query for second extension extValueQuery = string.Format(commonDataXml, "<measureClass>length</measureClass>"); queryXml = string.Format(BasicXMLTemplate, Trajectory.UidWell, Trajectory.UidWellbore, Trajectory.Uid, extValueQuery); result = DevKit.Query <TrajectoryList, Trajectory>(ObjectTypes.Trajectory, queryXml, null, OptionsIn.ReturnElements.Requested); Assert.IsNotNull(result); Assert.AreEqual(1, result.Count); resultTrajectory = result[0]; Assert.IsNotNull(resultTrajectory); commonData = resultTrajectory.CommonData; Assert.IsNotNull(commonData); Assert.AreEqual(1, commonData.ExtensionNameValue.Count); env = commonData.ExtensionNameValue[0]; Assert.IsNotNull(env); Assert.AreEqual(extensionName2.Uid, env.Uid); Assert.AreEqual(extensionName2.Name, env.Name); // Query for third extension extValueQuery = string.Format(commonDataXml, "<dataType>unknown</dataType>"); queryXml = string.Format(BasicXMLTemplate, Trajectory.UidWell, Trajectory.UidWellbore, Trajectory.Uid, extValueQuery); result = DevKit.Query <TrajectoryList, Trajectory>(ObjectTypes.Trajectory, queryXml, null, OptionsIn.ReturnElements.Requested); Assert.IsNotNull(result); Assert.AreEqual(1, result.Count); resultTrajectory = result[0]; Assert.IsNotNull(resultTrajectory); commonData = resultTrajectory.CommonData; Assert.IsNotNull(commonData); Assert.AreEqual(1, commonData.ExtensionNameValue.Count); env = commonData.ExtensionNameValue[0]; Assert.IsNotNull(env); Assert.AreEqual(extensionName3.Uid, env.Uid); Assert.AreEqual(extensionName3.Name, env.Name); }
public void Trajectory141DataAdapter_AddToStore_Can_Add_Trajectory() { AddParents(); DevKit.AddAndAssert <TrajectoryList, Trajectory>(Trajectory); }
public void Well131DataAdapter_AddToStore_Can_Add_Well() { AddParents(); DevKit.AddAndAssert <WellList, Well>(Well); }
protected virtual void AddParents() { DevKit.AddAndAssert <WellList, Well>(Well); DevKit.AddAndAssert <WellboreList, Wellbore>(Wellbore); }
public void StimJob141Validator_AddToStore_Error_481_StimJob_Parent_Does_Not_Exist() { DevKit.AddAndAssert(StimJob, ErrorCodes.MissingParentDataObject); }
public void StimJob141Validator_GetFromStore_Error_403_RequestObjectSelectionCapability_True_BadNamespace() { var response = DevKit.GetFromStore(ObjectTypes.StimJob, QueryInvalidNamespace, null, optionsIn: OptionsIn.RequestObjectSelectionCapability.True); Assert.AreEqual((short)ErrorCodes.MissingDefaultWitsmlNamespace, response.Result); }
public void ToolErrorModel141Validator_UpdateInStore_Error_433_ToolErrorModel_Does_Not_Exist() { AddParents(); DevKit.UpdateAndAssert <ToolErrorModelList, ToolErrorModel>(ToolErrorModel, ErrorCodes.DataObjectNotExist); }
public void ToolErrorModel141Validator_AddToStore_Error_401_No_Plural_Root_Element() { var response = DevKit.AddToStore(ObjectTypes.ToolErrorModel, QueryInvalidPluralRoot, null, null); Assert.AreEqual((short)ErrorCodes.MissingPluralRootElement, response?.Result); }
public void FormationMarker131Validator_AddToStore_Error_406_FormationMarker_Missing_Parent_Uid() { AddParents(); FormationMarker.UidWellbore = null; DevKit.AddAndAssert(FormationMarker, ErrorCodes.MissingElementUidForAdd); }
public void ToolErrorModel141Validator_AddToStore_Error_405_ToolErrorModel_Already_Exists() { AddParents(); DevKit.AddAndAssert <ToolErrorModelList, ToolErrorModel>(ToolErrorModel); DevKit.AddAndAssert <ToolErrorModelList, ToolErrorModel>(ToolErrorModel, ErrorCodes.DataObjectUidAlreadyExists); }
public void Activity200_Ensure_Creates_Activity_With_Default_Values() { DevKit.EnsureAndAssert(Activity); }
public void Trajectory141_Ensure_Creates_Trajectory_With_Default_Values() { DevKit.EnsureAndAssert <TrajectoryList, Trajectory>(Trajectory); }
public void Wellbore200_Ensure_Creates_Wellbore_With_Default_Values() { DevKit.EnsureAndAssert(Wellbore); }
public void StimJob141Validator_AddToStore_Error_406_StimJob_Missing_Parent_Uid() { AddParents(); StimJob.UidWellbore = null; DevKit.AddAndAssert(StimJob, ErrorCodes.MissingElementUidForAdd); }
public void DepthRegImage200_Ensure_Creates_DepthRegImage_With_Default_Values() { DevKit.EnsureAndAssert(DepthRegImage); }
public void StimJob141Validator_UpdateInStore_Error_433_StimJob_Does_Not_Exist() { AddParents(); DevKit.UpdateAndAssert <StimJobList, StimJob>(StimJob, ErrorCodes.DataObjectNotExist); }
public void FormationMarker131Validator_AddToStore_Error_405_FormationMarker_Already_Exists() { AddParents(); DevKit.AddAndAssert <FormationMarkerList, FormationMarker>(FormationMarker); DevKit.AddAndAssert <FormationMarkerList, FormationMarker>(FormationMarker, ErrorCodes.DataObjectUidAlreadyExists); }
public void StimJob141Validator_DeleteFromStore_Error_401_No_Plural_Root_Element() { var response = DevKit.DeleteFromStore(ObjectTypes.StimJob, QueryInvalidPluralRoot, null, null); Assert.AreEqual((short)ErrorCodes.MissingPluralRootElement, response?.Result); }
public void FormationMarker131Validator_UpdateInStore_Error_433_FormationMarker_Does_Not_Exist() { AddParents(); DevKit.UpdateAndAssert <FormationMarkerList, FormationMarker>(FormationMarker, ErrorCodes.DataObjectNotExist); }
public void Well131DataAdapter_GetFromStore_Can_Get_Well() { AddParents(); DevKit.AddAndAssert <WellList, Well>(Well); DevKit.GetAndAssert <WellList, Well>(Well); }
public void FormationMarker131Validator_AddToStore_Error_481_FormationMarker_Parent_Does_Not_Exist() { DevKit.AddAndAssert(FormationMarker, ErrorCodes.MissingParentDataObject); }
public void Message131_Ensure_Creates_Message_With_Default_Values() { DevKit.EnsureAndAssert <MessageList, Message>(Message); }
public void FormationMarker131Validator_UpdateInStore_Error_401_No_Plural_Root_Element() { var response = DevKit.UpdateInStore(ObjectTypes.FormationMarker, QueryInvalidPluralRoot, null, null); Assert.AreEqual((short)ErrorCodes.MissingPluralRootElement, response?.Result); }
public void GrowingObject141DataAdapter_UpdateInStore_Append_Data_ExpireGrowingObjects() { //Add parents AddParents(); //Add log Log.StartIndex = new GenericMeasure(5, "m"); AddLogWithData(Log, LogIndexType.measureddepth, 10); var addedLog = DevKit.GetAndAssert(Log); var wellboreResult = DevKit.GetAndAssert(Wellbore); Assert.IsFalse(addedLog.ObjectGrowing.GetValueOrDefault()); Assert.IsFalse(wellboreResult.IsActive.GetValueOrDefault()); // Add trajectory with stations AddTrajectoryWithData(Trajectory, 3, 5); var addedTrajectory = DevKit.GetAndAssert(Trajectory); wellboreResult = DevKit.GetAndAssert(Wellbore); Assert.IsFalse(addedTrajectory.ObjectGrowing.GetValueOrDefault()); Assert.IsFalse(wellboreResult.IsActive.GetValueOrDefault()); //update log CreateAndUpdateLogData(Log, LogIndexType.measureddepth, new GenericMeasure(17, "m"), 6); var updatedLog = DevKit.GetAndAssert(Log); wellboreResult = DevKit.GetAndAssert(Wellbore); Assert.IsTrue(updatedLog.ObjectGrowing.GetValueOrDefault(), "Log ObjectGrowing"); Assert.IsTrue(wellboreResult.IsActive.GetValueOrDefault(), "Log-Well IsActive"); //update trajectory var station1 = Trajectory.TrajectoryStation.FirstOrDefault(); Assert.IsNotNull(station1); station1.Azi.Value++; var newStation = new TrajectoryStation { Uid = "sta-4", MD = new MeasuredDepthCoord { Uom = MeasuredDepthUom.m, Value = 10 }, TypeTrajStation = station1.TypeTrajStation, Azi = station1.Azi, }; CreateAndUpdateTrajectoryStations(Trajectory, new List <TrajectoryStation> { newStation }); var updatedTrajectory = DevKit.GetAndAssert(Trajectory); wellboreResult = DevKit.GetAndAssert(Wellbore); Assert.IsTrue(updatedTrajectory.ObjectGrowing.GetValueOrDefault(), "Trajectory ObjectGrowing"); Assert.IsTrue(wellboreResult.IsActive.GetValueOrDefault(), "Trajectory-Well IsActive"); //Change settings and wait WitsmlSettings.LogGrowingTimeoutPeriod = GrowingTimeoutPeriod; WitsmlSettings.TrajectoryGrowingTimeoutPeriod = GrowingTimeoutPeriod; Thread.Sleep(GrowingTimeoutPeriod * 1000); //Expire objects DevKit.Container.Resolve <ObjectGrowingManager>().ExpireGrowingObjects(); updatedLog = DevKit.GetAndAssert(Log); updatedTrajectory = DevKit.GetAndAssert(Trajectory); wellboreResult = DevKit.GetAndAssert(Wellbore); Assert.IsFalse(updatedLog.ObjectGrowing.GetValueOrDefault(), "Log ObjectGrowing"); Assert.IsFalse(updatedTrajectory.ObjectGrowing.GetValueOrDefault(), "Trajectory ObjectGrowing "); Assert.IsFalse(wellboreResult.IsActive.GetValueOrDefault(), "IsActive"); }
public void FormationMarker131Validator_GetFromStore_Error_403_RequestObjectSelectionCapability_True_MissingNamespace() { var response = DevKit.GetFromStore(ObjectTypes.FormationMarker, QueryMissingNamespace, null, optionsIn: OptionsIn.RequestObjectSelectionCapability.True); Assert.AreEqual((short)ErrorCodes.MissingDefaultWitsmlNamespace, response.Result); }
public void Trajectory141DataAdapter_GetFromStore_Can_Get_Trajectory() { AddParents(); DevKit.AddAndAssert <TrajectoryList, Trajectory>(Trajectory); DevKit.GetAndAssert <TrajectoryList, Trajectory>(Trajectory); }
public void StimJob141Validator_AddToStore_Error_405_StimJob_Already_Exists() { AddParents(); DevKit.AddAndAssert <StimJobList, StimJob>(StimJob); DevKit.AddAndAssert <StimJobList, StimJob>(StimJob, ErrorCodes.DataObjectUidAlreadyExists); }
public void Log131DataAdapter_UpdateInStore_UpdateLog_Data_And_Index_Range() { Log.StartIndex = new GenericMeasure(15, "m"); AddLogWithData(Log, LogIndexType.measureddepth, 8); // Make sure there are 3 curves var lciUids = Log.LogCurveInfo.Select(l => l.Uid).ToArray(); Assert.AreEqual(3, lciUids.Length); var logAdded = GetLog(Log); Assert.IsNotNull(logAdded); Assert.AreEqual(15, logAdded.StartIndex.Value); Assert.AreEqual(22, logAdded.EndIndex.Value); var mdCurve = DevKit.GetLogCurveInfoByUid(logAdded.LogCurveInfo, lciUids[0]) as LogCurveInfo; Assert.IsNotNull(mdCurve); Assert.AreEqual(logAdded.StartIndex.Value, mdCurve.MinIndex.Value); Assert.AreEqual(logAdded.EndIndex.Value, mdCurve.MaxIndex.Value); var curve2 = DevKit.GetLogCurveInfoByUid(logAdded.LogCurveInfo, lciUids[1]) as LogCurveInfo; Assert.IsNull(curve2); var curve3 = DevKit.GetLogCurveInfoByUid(logAdded.LogCurveInfo, lciUids[2]) as LogCurveInfo; Assert.IsNotNull(curve3); Assert.AreEqual(logAdded.StartIndex.Value, curve3.MinIndex.Value); Assert.AreEqual(logAdded.EndIndex.Value, curve3.MaxIndex.Value); var update = CreateLogDataUpdate(Log, LogIndexType.measureddepth, new GenericMeasure(13, "m"), 6, 0.9); var logData = update.LogData; logData.Clear(); logData.Add("13,13.1,"); logData.Add("14,14.1,"); logData.Add("15,15.1,"); logData.Add("16,16.1,"); logData.Add("17,17.1,"); logData.Add("20,20.1,20.2"); logData.Add("21,,21.2"); logData.Add("22,,22.2"); logData.Add("23,,23.2"); UpdateLogData(update); var logUpdated = GetLog(Log); logData = logUpdated.LogData; Assert.IsNotNull(logData); Assert.AreEqual(11, logData.Count); Assert.AreEqual(13, logUpdated.StartIndex.Value); Assert.AreEqual(23, logUpdated.EndIndex.Value); mdCurve = DevKit.GetLogCurveInfoByUid(logUpdated.LogCurveInfo, lciUids[0]) as LogCurveInfo; Assert.IsNotNull(mdCurve); Assert.AreEqual(logUpdated.StartIndex.Value, mdCurve.MinIndex.Value); Assert.AreEqual(logUpdated.EndIndex.Value, mdCurve.MaxIndex.Value); curve2 = DevKit.GetLogCurveInfoByUid(logUpdated.LogCurveInfo, lciUids[1]) as LogCurveInfo; Assert.IsNotNull(curve2); Assert.AreEqual(13, curve2.MinIndex.Value); Assert.AreEqual(20, curve2.MaxIndex.Value); curve3 = DevKit.GetLogCurveInfoByUid(logUpdated.LogCurveInfo, lciUids[2]) as LogCurveInfo; Assert.IsNotNull(curve3); Assert.AreEqual(15, curve3.MinIndex.Value); Assert.AreEqual(23, curve3.MaxIndex.Value); }
public void Rig141DataAdapter_GetFromStore_Can_Get_Rig() { AddParents(); DevKit.AddAndAssert <RigList, Rig>(Rig); DevKit.GetAndAssert <RigList, Rig>(Rig); }