Beispiel #1
0
        public void QuickpurgeTest()
        {
            //Arrange
            int    cateId, objectId;
            Client myClient = new Client(URL, APIKEY, LANGUAGE);

            myClient.Username = "******";
            myClient.Password = "******";
            Obj          objectRequest   = new Obj(myClient);
            ModelRequset categoryRequest = new ModelRequset();
            Model        model           = new Model(myClient);

            //Act:Create the Object
            objectRequest.type       = ObjectType.CLIENT;
            objectRequest.title      = " My Client";
            objectRequest.cmdbStatus = CmdbStatus.INOPERATION;
            objectId = objectRequest.Create();

            //Act: Create the Category
            categoryRequest.title        = "Web GUI";
            categoryRequest.description  = "Web GUI description";
            categoryRequest.manufacturer = 1;
            cateId = model.Create(objectId, categoryRequest);

            //Act
            model.Quickpurge(objectId, cateId);
        }
Beispiel #2
0
        public void CreateTest()
        {
            //Arrange
            int cateId, objectId;
            List <ModelResponse[]> list            = new List <ModelResponse[]>();
            ModelRequset           categoryRequest = new ModelRequset();
            Client myClient = new Client(URL, APIKEY, LANGUAGE);

            myClient.Username = "******";
            myClient.Password = "******";
            Obj   objectRequest = new Obj(myClient);
            Model model         = new Model(myClient);

            //Act:Create the Object
            objectRequest.type  = ObjectType.CLIENT;
            objectRequest.title = " My Client";

            objectRequest.cmdbStatus = CmdbStatus.INOPERATION;
            objectId = objectRequest.Create();

            //Act: Create the Category
            categoryRequest.title        = "Web GUI";
            categoryRequest.manufacturer = 1;
            categoryRequest.description  = "Web GUI description";
            cateId = model.Create(objectId, categoryRequest);

            //Assert
            Assert.IsNotNull(cateId);

            //Act: Read the Category
            list = model.Read(objectId);


            //Assert
            foreach (ModelResponse[] row in list)
            {
                foreach (ModelResponse element in row)
                {
                    Assert.IsNotNull(element.title);
                    Assert.IsNotNull(element.id);
                }
            }

            //Act:Delete the Object
            objectRequest.Delete(objectId);
        }