示例#1
0
        public async Task WbGeometry131_PutObject_Can_Add_WbGeometry()
        {
            AddParents();
            await RequestSessionAndAssert();

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

            var dataObject = CreateDataObject <WbGeometryList, WbGeometry>(uri, WbGeometry);

            // Get Object
            var args = await GetAndAssert(handler, uri);

            // Check for message flag indicating No Data
            Assert.IsNotNull(args?.Header);
            Assert.AreEqual((int)MessageFlags.NoData, args.Header.MessageFlags);

            // Put Object
            await PutAndAssert(handler, dataObject);

            // Get Object
            args = await GetAndAssert(handler, uri);

            // Check Data Object XML
            Assert.IsNotNull(args?.Message.DataObject);
            var xml = args.Message.DataObject.GetString();

            var result = Parse <WbGeometryList, WbGeometry>(xml);

            Assert.IsNotNull(result);
        }
        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)
            };
            WbGeometry = new WbGeometry
            {
                Uid          = DevKit.Uid(),
                Name         = DevKit.Name("WbGeometry"),
                UidWell      = Well.Uid,
                NameWell     = Well.Name,
                UidWellbore  = Wellbore.Uid,
                NameWellbore = Wellbore.Name
            };

            QueryEmptyList = DevKit.List(new WbGeometry());
        }
        public async Task WbGeometry131_PutObject_Can_Add_WbGeometry()
        {
            AddParents();
            await RequestSessionAndAssert();

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

            var dataObject = CreateDataObject <WbGeometryList, WbGeometry>(uri, WbGeometry);

            // 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 <WbGeometryList, WbGeometry>(xml);

            Assert.IsNotNull(result);
        }
示例#4
0
        public void WbGeometry131_GetResources_IsValidUri()
        {
            var providers = DevKit.Container.ResolveAll <PDS.WITSMLstudio.Store.Providers.Discovery.IDiscoveryStoreProvider>();

            Assert.IsNotNull(providers);

            var list = providers.ToList();

            Assert.IsTrue(list.Any());

            foreach (var provider in list)
            {
                Debug.WriteLine(provider.DataSchemaVersion);
            }

            var actual = list.FirstOrDefault(x => x.DataSchemaVersion == "1.3.1.1") as Providers.Discovery.Witsml131Provider;

            Assert.IsNotNull(actual);

            var access = new PrivateObject(actual);

            var uri       = WbGeometry.GetUri();
            var parentUri = uri.Parent;
            var folderUri = parentUri.Append(uri.ObjectType);

            bool valid = (bool)access.Invoke("IsValidUri", folderUri);

            Assert.IsTrue(valid);
        }
示例#5
0
        public async Task WbGeometry131_GetResources_Can_Get_All_WbGeometry_Resources_2()
        {
            AddParents();
            DevKit.AddAndAssert <WbGeometryList, WbGeometry>(WbGeometry);
            {
                var actual = await RequestSessionAndAssert();

                Assert.IsNotNull(actual);
            }

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

            {
                var actual = await GetResourcesAndAssert(parentUri);

                Assert.IsNotNull(actual);
                Assert.IsTrue(actual.Any());
            }

            {
                var folderUri = parentUri.Append(uri.ObjectType);
                var actual    = await GetResourcesAndAssert(folderUri);

                Assert.IsNotNull(actual);
                Assert.IsTrue(actual.Any());
            }
        }
        public async Task WbGeometry131_PutObject_Can_Update_WbGeometry()
        {
            AddParents();
            await RequestSessionAndAssert();

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

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

            var dataObject = CreateDataObject <WbGeometryList, WbGeometry>(uri, WbGeometry);

            // 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 <WbGeometryList, WbGeometry>(xml);

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

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

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

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

            var uri       = WbGeometry.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 DevKit131Aspect(TestContext);

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

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

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

            BeforeEachTest();
            OnTestSetUp();
        }
示例#9
0
        public async Task WbGeometry131_PutObject_Can_Update_WbGeometry()
        {
            AddParents();
            await RequestSessionAndAssert();

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

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

            var dataObject = CreateDataObject <WbGeometryList, WbGeometry>(uri, WbGeometry);

            // Get Object
            var args = await GetAndAssert(handler, uri);

            // Check for message flag indicating No Data
            Assert.IsNotNull(args?.Header);
            Assert.AreEqual((int)MessageFlags.NoData, args.Header.MessageFlags);

            // Put Object for Add
            await PutAndAssert(handler, dataObject);

            // Get Added Object
            args = await GetAndAssert(handler, uri);

            // Check Added Data Object XML
            Assert.IsNotNull(args?.Message.DataObject);
            var xml = args.Message.DataObject.GetString();

            var result = Parse <WbGeometryList, WbGeometry>(xml);

            Assert.IsNotNull(result);

            Assert.IsNotNull(result.CommonData.Comments);

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

            var updateDataObject = CreateDataObject <WbGeometryList, WbGeometry>(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 <WbGeometryList, WbGeometry>(updateXml);

            Assert.IsNotNull(result);

            // Test Data Object overwrite

            Assert.IsNull(result.CommonData.Comments);
        }