protected override void PrepareData() { DevKit.Store.CapServerProviders = DevKit.Store.CapServerProviders .Where(x => x.DataSchemaVersion == OptionsIn.DataVersion.Version141.Value) .ToArray(); Well = new Well { Uid = DevKit.Uid(), Name = DevKit.Name("Well"), TimeZone = DevKit.TimeZone }; Wellbore = new Wellbore { Uid = DevKit.Uid(), Name = DevKit.Name("Wellbore"), UidWell = Well.Uid, NameWell = Well.Name, MD = new MeasuredDepthCoord(0, MeasuredDepthUom.ft) }; DepthRegImage = new DepthRegImage { Uid = DevKit.Uid(), Name = DevKit.Name("DepthRegImage"), UidWell = Well.Uid, NameWell = Well.Name, UidWellbore = Wellbore.Uid, NameWellbore = Wellbore.Name }; QueryEmptyList = DevKit.List(new DepthRegImage()); }
public async Task DepthRegImage141_PutObject_Can_Add_DepthRegImage() { AddParents(); await RequestSessionAndAssert(); var handler = _client.Handler <IStoreCustomer>(); var uri = DepthRegImage.GetUri(); var dataObject = CreateDataObject <DepthRegImageList, DepthRegImage>(uri, DepthRegImage); // Get Object Expecting it Not to Exist await GetAndAssert(handler, uri, Energistics.Etp.EtpErrorCodes.NotFound); // Put Object await PutAndAssert(handler, dataObject); // Get Object var args = await GetAndAssert(handler, uri); // Check Data Object XML Assert.IsNotNull(args?.Message.DataObject); var xml = args.Message.DataObject.GetString(); var result = Parse <DepthRegImageList, DepthRegImage>(xml); Assert.IsNotNull(result); }
protected override void PrepareData() { Well = new Well { Uuid = DevKit.Uid(), Citation = DevKit.Citation("Well"), GeographicLocationWGS84 = DevKit.Location(), SchemaVersion = "2.0", TimeZone = DevKit.TimeZone }; Wellbore = new Wellbore { Uuid = DevKit.Uid(), Citation = DevKit.Citation("Wellbore"), Well = DevKit.DataObjectReference(Well), SchemaVersion = "2.0" }; DepthRegImage = new DepthRegImage { Uuid = DevKit.Uid(), Citation = DevKit.Citation("DepthRegImage"), Wellbore = DevKit.DataObjectReference(Wellbore), SchemaVersion = EtpUris.GetUriFamily(typeof(DepthRegImage)).Version, }; }
/// <summary> /// Sets additional default values for the specified data object. /// </summary> /// <param name="dataObject">The data object.</param> /// <param name="uri">The URI.</param> partial void SetAdditionalDefaultValues(DepthRegImage dataObject, EtpUri uri) { dataObject.FileName = new FileName { Value = "Default", NameType = Energistics.DataAccess.WITSML141.ReferenceData.FileNameType.unknown }; }
public async Task DepthRegImage200_PutObject_Can_Update_DepthRegImage() { AddParents(); await RequestSessionAndAssert(); var handler = _client.Handler <IStoreCustomer>(); var uri = DepthRegImage.GetUri(); // Add a ExtensionNameValue to Data Object var envName = "TestPutObject"; var env = DevKit.ExtensionNameValue(envName, envName); DepthRegImage.ExtensionNameValue = new List <ExtensionNameValue>() { env }; var dataObject = CreateDataObject(uri, DepthRegImage); // Get Object Expecting it Not to Exist await GetAndAssert(handler, uri, Energistics.Etp.EtpErrorCodes.NotFound); // Put Object for Add await PutAndAssert(handler, dataObject); // Get Added Object var args = await GetAndAssert(handler, uri); // Check Added Data Object XML Assert.IsNotNull(args?.Message.DataObject); var xml = args.Message.DataObject.GetString(); var result = Parse <DepthRegImage>(xml); Assert.IsNotNull(result); Assert.IsNotNull(result.ExtensionNameValue.FirstOrDefault(e => e.Name.Equals(envName))); // Remove Comment from Data Object result.ExtensionNameValue.Clear(); var updateDataObject = CreateDataObject(uri, result); // Put Object for Update await PutAndAssert(handler, updateDataObject); // Get Updated Object args = await GetAndAssert(handler, uri); // Check Added Data Object XML Assert.IsNotNull(args?.Message.DataObject); var updateXml = args.Message.DataObject.GetString(); result = Parse <DepthRegImage>(updateXml); Assert.IsNotNull(result); // Test Data Object overwrite Assert.IsNull(result.ExtensionNameValue.FirstOrDefault(e => e.Name.Equals(envName))); }
/// <summary> /// Sets additional default values for the specified data object. /// </summary> /// <param name="dataObject">The data object.</param> /// <param name="uri">The URI.</param> partial void SetAdditionalDefaultValues(DepthRegImage dataObject, EtpUri uri) { dataObject.Uid = "Default"; dataObject.FileName = "Default"; dataObject.ImageBoundary = new Energistics.DataAccess.WITSML200.ComponentSchemas.DepthRegRectangle { Uid = "Default" }; }
public async Task DepthRegImage141_PutObject_Can_Update_DepthRegImage() { AddParents(); await RequestSessionAndAssert(); var handler = _client.Handler <IStoreCustomer>(); var uri = DepthRegImage.GetUri(); // Add a Comment to Data Object DepthRegImage.CommonData = new CommonData() { Comments = "Test PutObject" }; var dataObject = CreateDataObject <DepthRegImageList, DepthRegImage>(uri, DepthRegImage); // Get Object Expecting it Not to Exist await GetAndAssert(handler, uri, Energistics.Etp.EtpErrorCodes.NotFound); // Put Object for Add await PutAndAssert(handler, dataObject); // Get Added Object var args = await GetAndAssert(handler, uri); // Check Added Data Object XML Assert.IsNotNull(args?.Message.DataObject); var xml = args.Message.DataObject.GetString(); var result = Parse <DepthRegImageList, DepthRegImage>(xml); Assert.IsNotNull(result); Assert.IsNotNull(result.CommonData.Comments); // Remove Comment from Data Object result.CommonData.Comments = null; var updateDataObject = CreateDataObject <DepthRegImageList, DepthRegImage>(uri, result); // Put Object for Update await PutAndAssert(handler, updateDataObject); // Get Updated Object args = await GetAndAssert(handler, uri); // Check Added Data Object XML Assert.IsNotNull(args?.Message.DataObject); var updateXml = args.Message.DataObject.GetString(); result = Parse <DepthRegImageList, DepthRegImage>(updateXml); Assert.IsNotNull(result); // Test Data Object overwrite Assert.IsNull(result.CommonData.Comments); }
public async Task DepthRegImage141_GetResources_Can_Get_All_DepthRegImage_Resources() { AddParents(); DevKit.AddAndAssert <DepthRegImageList, DepthRegImage>(DepthRegImage); await RequestSessionAndAssert(); var uri = DepthRegImage.GetUri(); var parentUri = uri.Parent; await GetResourcesAndAssert(parentUri); var folderUri = parentUri.Append(uri.ObjectType); await GetResourcesAndAssert(folderUri); }