예제 #1
0
        public void TestSetUp()
        {
            Logger.Debug($"Executing {TestContext.TestName}");
            DevKit = new DevKit200Aspect(TestContext);

            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"
            };
            FluidsReport = new FluidsReport
            {
                Uuid     = DevKit.Uid(),
                Citation = DevKit.Citation("FluidsReport"),

                Wellbore      = DevKit.DataObjectReference(Wellbore),
                SchemaVersion = EtpUris.GetUriFamily(typeof(FluidsReport)).Version,
            };

            BeforeEachTest();
            OnTestSetUp();
        }
        public async Task FluidsReport131_PutObject_Can_Add_FluidsReport()
        {
            AddParents();
            await RequestSessionAndAssert();

            var handler = _client.Handler <IStoreCustomer>();
            var uri     = FluidsReport.GetUri();

            var dataObject = CreateDataObject <FluidsReportList, FluidsReport>(uri, FluidsReport);

            // 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 <FluidsReportList, FluidsReport>(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"
     };
     FluidsReport = new FluidsReport
     {
         Uuid          = DevKit.Uid(),
         Citation      = DevKit.Citation("FluidsReport"),
         Wellbore      = DevKit.DataObjectReference(Wellbore),
         SchemaVersion = EtpUris.GetUriFamily(typeof(FluidsReport)).Version,
     };
 }
        protected override void PrepareData()
        {
            DevKit.Store.CapServerProviders = DevKit.Store.CapServerProviders
                                              .Where(x => x.DataSchemaVersion == OptionsIn.DataVersion.Version131.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,
                MDCurrent = new MeasuredDepthCoord(0, MeasuredDepthUom.ft)
            };
            FluidsReport = new FluidsReport
            {
                Uid          = DevKit.Uid(),
                Name         = DevKit.Name("FluidsReport"),
                UidWell      = Well.Uid,
                NameWell     = Well.Name,
                UidWellbore  = Wellbore.Uid,
                NameWellbore = Wellbore.Name
            };

            QueryEmptyList = DevKit.List(new FluidsReport());
        }
예제 #5
0
 /// <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(FluidsReport dataObject, EtpUri uri)
 {
     dataObject.DateTime = new Timestamp(DateTimeOffset.UtcNow);
     dataObject.MD       = new MeasuredDepthCoord(0, LengthUom.ft)
     {
         Datum = "SL"
     };
 }
        public async Task FluidsReport200_PutObject_Can_Update_FluidsReport()
        {
            AddParents();
            await RequestSessionAndAssert();

            var handler = _client.Handler <IStoreCustomer>();
            var uri     = FluidsReport.GetUri();

            // Add a ExtensionNameValue to Data Object
            var envName = "TestPutObject";
            var env     = DevKit.ExtensionNameValue(envName, envName);

            FluidsReport.ExtensionNameValue = new List <ExtensionNameValue>()
            {
                env
            };

            var dataObject = CreateDataObject(uri, FluidsReport);

            // 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 <FluidsReport>(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 <FluidsReport>(updateXml);
            Assert.IsNotNull(result);

            // Test Data Object overwrite
            Assert.IsNull(result.ExtensionNameValue.FirstOrDefault(e => e.Name.Equals(envName)));
        }
        public async Task FluidsReport131_PutObject_Can_Update_FluidsReport()
        {
            AddParents();
            await RequestSessionAndAssert();

            var handler = _client.Handler <IStoreCustomer>();
            var uri     = FluidsReport.GetUri();

            // Add a Comment to Data Object
            FluidsReport.CommonData = new CommonData()
            {
                Comments = "Test PutObject"
            };

            var dataObject = CreateDataObject <FluidsReportList, FluidsReport>(uri, FluidsReport);

            // 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 <FluidsReportList, FluidsReport>(xml);

            Assert.IsNotNull(result);
            Assert.IsNotNull(result.CommonData.Comments);

            // Remove Comment from Data Object
            result.CommonData.Comments = null;

            var updateDataObject = CreateDataObject <FluidsReportList, FluidsReport>(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 <FluidsReportList, FluidsReport>(updateXml);
            Assert.IsNotNull(result);

            // Test Data Object overwrite
            Assert.IsNull(result.CommonData.Comments);
        }
        public async Task FluidsReport131_GetResources_Can_Get_All_FluidsReport_Resources()
        {
            AddParents();
            DevKit.AddAndAssert <FluidsReportList, FluidsReport>(FluidsReport);
            await RequestSessionAndAssert();

            var uri       = FluidsReport.GetUri();
            var parentUri = uri.Parent;

            await GetResourcesAndAssert(parentUri);

            var folderUri = parentUri.Append(uri.ObjectType);

            await GetResourcesAndAssert(folderUri);
        }
        public void TestSetUp()
        {
            Logger.Debug($"Executing {TestContext.TestName}");
            DevKit = new DevKit141Aspect(TestContext);

            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)
            };
            FluidsReport = new FluidsReport
            {
                Uid  = DevKit.Uid(),
                Name = DevKit.Name("FluidsReport"),

                UidWell      = Well.Uid,
                NameWell     = Well.Name,
                UidWellbore  = Wellbore.Uid,
                NameWellbore = Wellbore.Name
            };

            QueryEmptyList = DevKit.List(new FluidsReport());

            BeforeEachTest();
            OnTestSetUp();
        }