コード例 #1
0
        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)
            };
            ConvCore = new ConvCore
            {
                Uid          = DevKit.Uid(),
                Name         = DevKit.Name("ConvCore"),
                UidWell      = Well.Uid,
                NameWell     = Well.Name,
                UidWellbore  = Wellbore.Uid,
                NameWellbore = Wellbore.Name
            };

            QueryEmptyList = DevKit.List(new ConvCore());
        }
コード例 #2
0
        public async Task ConvCore131_PutObject_Can_Add_ConvCore()
        {
            AddParents();
            await RequestSessionAndAssert();

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

            var dataObject = CreateDataObject <ConvCoreList, ConvCore>(uri, ConvCore);

            // 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 <ConvCoreList, ConvCore>(xml);

            Assert.IsNotNull(result);
        }
コード例 #3
0
        public async Task ConvCore131_PutObject_Can_Update_ConvCore()
        {
            AddParents();
            await RequestSessionAndAssert();

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

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

            var dataObject = CreateDataObject <ConvCoreList, ConvCore>(uri, ConvCore);

            // 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 <ConvCoreList, ConvCore>(xml);

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

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

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

            // Test Data Object overwrite
            Assert.IsNull(result.CommonData.Comments);
        }
コード例 #4
0
        public async Task ConvCore131_GetResources_Can_Get_All_ConvCore_Resources()
        {
            AddParents();
            DevKit.AddAndAssert <ConvCoreList, ConvCore>(ConvCore);
            await RequestSessionAndAssert();

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

            await GetResourcesAndAssert(parentUri);

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

            await GetResourcesAndAssert(folderUri);
        }
コード例 #5
0
        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)
            };
            ConvCore = new ConvCore
            {
                Uid  = DevKit.Uid(),
                Name = DevKit.Name("ConvCore"),

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

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

            BeforeEachTest();
            OnTestSetUp();
        }