public async Task ToolErrorModel200_PutObject_Can_Add_ToolErrorModel()
        {
            AddParents();
            await RequestSessionAndAssert();

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

            var dataObject = CreateDataObject(uri, ToolErrorModel);

            // 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 <ToolErrorModel>(xml);

            Assert.IsNotNull(result);
        }
        public async Task ToolErrorModel200_PutObject_Can_Update_ToolErrorModel()
        {
            AddParents();
            await RequestSessionAndAssert();

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

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

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

            var dataObject = CreateDataObject(uri, ToolErrorModel);

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

            // Test Data Object overwrite
            Assert.IsNull(result.ExtensionNameValue.FirstOrDefault(e => e.Name.Equals(envName)));
        }
 protected override void PrepareData()
 {
     ToolErrorModel = new ToolErrorModel
     {
         SchemaVersion = EtpUris.GetUriFamily(typeof(ToolErrorModel)).Version,
         Uuid          = DevKit.Uid(),
         Citation      = DevKit.Citation("ToolErrorModel")
     };
 }
Exemplo n.º 4
0
        public async Task ToolErrorModel141_PutObject_Can_Update_ToolErrorModel()
        {
            AddParents();
            await RequestSessionAndAssert();

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

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

            var dataObject = CreateDataObject <ToolErrorModelList, ToolErrorModel>(uri, ToolErrorModel);

            // 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 <ToolErrorModelList, ToolErrorModel>(xml);

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

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

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

            // Test Data Object overwrite
            Assert.IsNull(result.CommonData.Comments);
        }
        public async Task ToolErrorModel200_GetResources_Can_Get_All_ToolErrorModel_Resources()
        {
            AddParents();
            DevKit.AddAndAssert(ToolErrorModel);
            await RequestSessionAndAssert();

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

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

            await GetResourcesAndAssert(folderUri);
        }
Exemplo n.º 6
0
        protected override void PrepareData()
        {
            DevKit.Store.CapServerProviders = DevKit.Store.CapServerProviders
                                              .Where(x => x.DataSchemaVersion == OptionsIn.DataVersion.Version141.Value)
                                              .ToArray();

            ToolErrorModel = new ToolErrorModel
            {
                Uid  = DevKit.Uid(),
                Name = DevKit.Name("ToolErrorModel")
            };

            QueryEmptyList = DevKit.List(new ToolErrorModel());
        }
Exemplo n.º 7
0
        public void TestSetUp()
        {
            Logger.Debug($"Executing {TestContext.TestName}");
            DevKit = new DevKit200Aspect(TestContext);

            ToolErrorModel = new ToolErrorModel
            {
                SchemaVersion = EtpUris.GetUriFamily(typeof(ToolErrorModel)).Version,

                Uuid     = DevKit.Uid(),
                Citation = DevKit.Citation("ToolErrorModel")
            };

            BeforeEachTest();
            OnTestSetUp();
        }
Exemplo n.º 8
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();

            ToolErrorModel = new ToolErrorModel
            {
                Uid  = DevKit.Uid(),
                Name = DevKit.Name("ToolErrorModel")
            };

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

            BeforeEachTest();
            OnTestSetUp();
        }