コード例 #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);
            LocationRequset categoryRequest = new LocationRequset();
            Location        Location        = new Location(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.latitude         = "12";
            categoryRequest.longitude        = "323";
            categoryRequest.snmp_syslocation = "23";
            categoryRequest.description      = "Web GUI description";
            cateId = Location.Create(objectId, categoryRequest);

            //Act
            Location.Quickpurge(objectId, cateId);
        }
コード例 #2
0
        public void UpdateTest()
        {
            //Arrange
            int cateId, objectId;
            List <LocationResponse[]> list = new List <LocationResponse[]>();
            Client myClient = new Client(URL, APIKEY, LANGUAGE);

            myClient.Username = "******";
            myClient.Password = "******";
            Obj             objectRequest   = new Obj(myClient);
            LocationRequset categoryRequest = new LocationRequset();
            Location        Location        = new Location(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.latitude         = "12";
            categoryRequest.longitude        = "323";
            categoryRequest.snmp_syslocation = "23";
            categoryRequest.description      = "Web GUI description";

            cateId = Location.Create(objectId, categoryRequest);

            //Act: Update the Category
            categoryRequest.latitude         = "12";
            categoryRequest.longitude        = "323";
            categoryRequest.snmp_syslocation = "23";
            categoryRequest.description      = "Web GUI 2 description";

            Location.Update(objectId, categoryRequest);

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

            //Assert
            foreach (LocationResponse[] row in list)
            {
                foreach (LocationResponse element in row)
                {
                    Assert.AreEqual("Web GUI 2 description", categoryRequest.description);
                }
            }
            //Act:Delete the Object
            objectRequest.Delete(objectId);
        }