예제 #1
0
        public void QuickpurgeTest()
        {
            //Arrange
            int cateId, objectId;
            var objectRequest   = new IdoitObjectInstance(idoitClient);
            var categoryRequest = new ModelRequest();
            var model           = new IdoitSvcInstance <ModelResponse>(idoitClient);

            //Act:Create the Object
            objectRequest.CmdbStatus = IdoitCmdbStatus.INOPERATION;
            objectRequest.Type       = IdoitObjectTypes.CLIENT;
            objectRequest.Value      = "My Client";
            objectId = objectRequest.Create();

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

            //Act
            model.CateId = cateId;
            model.Purge();

            objectRequest.ObjectId = objectId;
            objectRequest.Purge();
        }
예제 #2
0
        public void CreateReadTest()
        {
            //Arrange
            int cateId, objectId;
            var objectRequest   = new IdoitObjectInstance(idoitClient);
            var categoryRequest = new IPRequest();
            var IP = new IdoitMvcInstance <IPResponse>(idoitClient);

            //Act:Create the Object
            objectRequest.CmdbStatus = IdoitCmdbStatus.INOPERATION;
            objectRequest.Type       = IdoitObjectTypes.CLUSTER;
            objectRequest.Value      = "My Cluster 2";
            objectId = objectRequest.Create();

            //Act: Create the Category
            categoryRequest.ipv4_address = "1.1.1.2";
            categoryRequest.description  = "Web GUI description";
            IP.ObjectId      = objectId;
            IP.ObjectRequest = categoryRequest;
            cateId           = IP.Create();

            //Act:Read the Category
            var list = IP.Read();

            Assert.IsTrue(list.Length > 0, "No objects found");
            //Assert
            foreach (IPResponse v in list)
            {
                Assert.IsNotNull(v.ipv4_address.refTitle);
            }
            //Act:Delete the Object
            objectRequest.ObjectId = objectId;
            objectRequest.Delete();
        }
예제 #3
0
        public void QuickpurgeTest()
        {
            //Arrange
            int cateId, objectId;
            var objectRequest   = new IdoitObjectInstance(idoitClient);
            var categoryRequest = new AccessRequest();
            var access          = new IdoitMvcInstance <AccessResponse>(idoitClient);

            //Act:Create the Object
            objectRequest.CmdbStatus = IdoitCmdbStatus.INOPERATION;
            objectRequest.Type       = IdoitObjectTypes.CLIENT;
            objectRequest.Value      = "My Client";
            objectId = objectRequest.Create();

            //Act: Create the Category
            categoryRequest.title         = "Web GUI";
            categoryRequest.description   = "Web GUI description";
            categoryRequest.type          = " ES";
            categoryRequest.formatted_url = "https://swsan.admin.acme-it.example/";
            access.ObjectId      = objectId;
            access.ObjectRequest = categoryRequest;
            cateId = access.Create();

            //Act
            access.CateId = cateId;
            access.Purge();

            objectRequest.ObjectId = objectId;
            objectRequest.Purge();
        }
예제 #4
0
        public void QuickpurgeTest()
        {
            //Arrange
            int cateId, objectId;
            var objectRequest   = new IdoitObjectInstance(idoitClient);
            var categoryRequest = new LocationRequest();
            var Location        = new IdoitSvcInstance <LocationResponse>(idoitClient);

            //Act:Create the Object
            objectRequest.CmdbStatus = IdoitCmdbStatus.INOPERATION;
            objectRequest.Type       = IdoitObjectTypes.CLIENT;
            objectRequest.Value      = "My IdoitClient";
            objectId = objectRequest.Create();

            //Act: Create the Category
            categoryRequest.latitude         = "12";
            categoryRequest.longitude        = "323";
            categoryRequest.snmp_syslocation = "23";
            categoryRequest.description      = "Web GUI description";
            Location.ObjectId      = objectId;
            Location.ObjectRequest = categoryRequest;
            cateId = Location.Create();

            //Act
            Location.CateId = cateId;
            Location.Purge();

            objectRequest.ObjectId = objectId;
            objectRequest.Purge();
        }
예제 #5
0
        public void UpdateTest()
        {
            //Arrange
            int cateId, objectId;
            var objectRequest   = new IdoitObjectInstance(idoitClient);
            var categoryRequest = new AccessRequest();
            var access          = new IdoitMvcInstance <AccessResponse>(idoitClient);

            //Act:Create the Object
            objectRequest.CmdbStatus = IdoitCmdbStatus.INOPERATION;
            objectRequest.Type       = IdoitObjectTypes.CLIENT;
            objectRequest.Value      = "My Client";
            objectId = objectRequest.Create();

            //Act: Create the Category
            categoryRequest.title         = "Web GUI";
            categoryRequest.description   = "Web GUI description";
            categoryRequest.type          = " ES";
            categoryRequest.formatted_url = "https://swsan.admin.acme-it.example/";
            access.ObjectId      = objectId;
            access.ObjectRequest = categoryRequest;
            cateId = access.Create();

            //Act: Update the Category
            categoryRequest.title         = "Web GUI 2";
            categoryRequest.description   = "Web GUI 2 description";
            categoryRequest.type          = " SE";
            categoryRequest.formatted_url = "https://swsan.admin.acme-it.example/";
            categoryRequest.category_id   = cateId;
            //categoryRequest.category_id = cateId;
            access.ObjectRequest = categoryRequest;
            access.Update();

            //Act:Read the Category
            var list = access.Read();

            Assert.IsTrue(list.Length > 0, "No objects found");
            //Assert
            foreach (AccessResponse v in list)
            {
                Assert.AreEqual("Web GUI 2", v.title);
            }

            //Act:Delete the Object
            objectRequest.ObjectId = objectId;
            objectRequest.Delete();
        }
예제 #6
0
        public void UpdateTest()
        {
            //Arrange
            int cateId, objectId;
            var objectRequest   = new IdoitObjectInstance(idoitClient);
            var categoryRequest = new LocationRequest();
            var Location        = new IdoitSvcInstance <LocationResponse>(idoitClient);

            //Act:Create the Object
            objectRequest.CmdbStatus = IdoitCmdbStatus.INOPERATION;
            objectRequest.Type       = IdoitObjectTypes.CLIENT;
            objectRequest.Value      = "My IdoitClient";
            objectId = objectRequest.Create();

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

            Location.ObjectId      = objectId;
            Location.ObjectRequest = categoryRequest;
            cateId = Location.Create();

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

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

            Assert.IsTrue(list.Length > 0, "No objects found");
            //Assert
            foreach (LocationResponse v in list)
            {
                Assert.AreEqual("Web GUI 2 description", v.description);
            }
            //Act:Delete the Object
            objectRequest.ObjectId = objectId;
            objectRequest.Delete();
        }
예제 #7
0
        public void PurgeTest()
        {
            //Arrange
            int objID;
            var request = new IdoitObjectInstance(idoitClient);

            //Act:Create the Object
            request.CmdbStatus = IdoitCmdbStatus.STORED;
            request.Type       = IdoitObjectTypes.MONITOR;
            request.Value      = "TFT 001";
            objID            = request.Create();
            request.ObjectId = objID;
            //Act:Purge the Object
            request.Purge();

            //Assert
            Assert.IsNotNull(objID);
        }
예제 #8
0
        public void ReadTest()
        {
            //Arrange
            var request       = new IdoitObjectsInstance(idoitClient);
            var requestCreate = new IdoitObjectInstance(idoitClient);
            var filter        = new IdoitObjectsFilter();

            int[] ObjectId = new int[10];

            //Act:Create the Objects
            for (int i = 0; i < 10; i++)
            {
                requestCreate.CmdbStatus = IdoitCmdbStatus.PLANNED;
                requestCreate.Type       = IdoitObjectTypes.SYSTEM_SERVICE;
                requestCreate.Value      = " System Service " + i;
                ObjectId[i] = requestCreate.Create();
            }

            //Act : Read Objects
            filter.ids  = new int[] { ObjectId[0], ObjectId[8] };
            filter.type = IdoitObjectTypes.SERVICE;
            //filter.title = "SystemService";
            request.Filter  = filter;
            request.OrderBy = IdoitOrderBy.Title;
            request.Sort    = IdoitSort.Acsending;
            request.Limit   = "0,10";
            var lists = request.Read();

            Assert.IsTrue(lists.Length > 0, "No objects found");
            //Assert

            foreach (var v in lists)
            {
                Assert.IsNotNull(v.title);
                Assert.IsNotNull(v.id);
            }

            //Act:Delete the Objects
            for (int i = 0; i < 10; i++)
            {
                requestCreate.ObjectId = ObjectId[i];
                requestCreate.Purge();
            }
        }
예제 #9
0
        public void UpdateTest()
        {
            //Arrange
            int cateId, objectId;
            var objectRequest   = new IdoitObjectInstance(idoitClient);
            var categoryRequest = new ModelRequest();
            var model           = new IdoitSvcInstance <ModelResponse>(idoitClient);

            //Act:Create the Object
            objectRequest.CmdbStatus = IdoitCmdbStatus.INOPERATION;
            objectRequest.Type       = IdoitObjectTypes.CLIENT;
            objectRequest.Value      = "My Client";
            objectId = objectRequest.Create();

            //Act: Create the Category
            categoryRequest.title        = "Web GUI";
            categoryRequest.description  = "Web GUI description";
            categoryRequest.manufacturer = 1;

            model.ObjectId      = objectId;
            model.ObjectRequest = categoryRequest;
            cateId = model.Create();

            //Act: Update the Category
            categoryRequest.title       = "Web GUI 2";
            categoryRequest.description = "Web GUI 2 description";
            model.ObjectRequest         = categoryRequest;
            model.Update();

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

            Assert.IsTrue(list.Length > 0, "No objects found");
            //Assert
            foreach (ModelResponse v in list)
            {
                Assert.AreEqual("Web GUI 2", v.title.title);
            }
            //Act:Delete the Object
            objectRequest.ObjectId = objectId;
            objectRequest.Delete();
        }
예제 #10
0
        public void DeleteTestCheckIfTheObjectDeleted()
        {
            //Arrange
            int objID;
            var result  = new IdoitObjectResult();
            var request = new IdoitObjectInstance(idoitClient);

            //Act:Create the Object
            request.CmdbStatus = IdoitCmdbStatus.PLANNED;
            request.Type       = IdoitObjectTypes.CLIENT;
            request.Value      = "Laptop 001";
            objID = request.Create();
            Assert.IsNotNull(objID);
            //Act:Delete the Object
            request.ObjectId = objID;
            request.Delete();
            //Act:Read the Object
            result = request.Read();
            //Assert
            Assert.AreEqual(IdoitStatusTypes.Deleted, result.status);
        }
예제 #11
0
        public void UpdateTest()
        {
            //Arrange
            int objID;
            var result  = new IdoitObjectResult();
            var request = new IdoitObjectInstance(idoitClient);

            //Act:Create the Object
            request.CmdbStatus = IdoitCmdbStatus.INOPERATION;
            request.Type       = IdoitObjectTypes.SERVER;
            request.Value      = "Switch Colo A001 02";
            objID = request.Create();
            //Act:Update the Object
            request.ObjectId = objID;
            request.Value    = "Switch Colo A001 01";
            request.Update();
            //Act:Read the Object
            result = request.Read();
            //Assert
            Assert.AreEqual("Switch Colo A001 01", result.title);
            request.Delete();
        }
예제 #12
0
        public void ArchiveTestCheckIfTheObjectArchived()
        {
            //Arrange
            int objID;
            var result  = new IdoitObjectResult();
            var request = new IdoitObjectInstance(idoitClient);

            //Act:Create the Object
            request.CmdbStatus = IdoitCmdbStatus.DEFECT;
            request.Type       = IdoitObjectTypes.ROUTER;
            request.Value      = "HQ Gateway";
            objID = request.Create();
            Assert.IsNotNull(objID);
            //Act:Archive the Object
            request.ObjectId = objID;
            request.Archive();

            //Act:Read the Object
            result = request.Read();

            //Assert
            Assert.AreEqual(IdoitStatusTypes.Archived, result.status);
        }
예제 #13
0
        public void ReadTest()
        {
            //Arrange
            int objID;
            var result  = new IdoitObjectResult();
            var request = new IdoitObjectInstance(idoitClient);

            //Act:Create the Object
            request.CmdbStatus = IdoitCmdbStatus.PLANNED;
            request.Type       = IdoitObjectTypes.SERVER;
            request.Value      = "Ceph Storage Pod A001 01";
            objID = request.Create();
            //Act:Read the Object
            request.ObjectId = objID;
            result           = request.Read();
            //Assert
            Assert.AreEqual(objID, result.id);
            Assert.AreEqual("Ceph Storage Pod A001 01", result.title);
            Assert.IsNotNull(result.title);
            Assert.IsNotNull(result.cmdbStatus);
            //Act:Delete the Object
            request.Delete();
        }
예제 #14
0
        public void SearchTest()
        {
            //Arrange
            int objID;
            var idoit   = new IdoitInstance(idoitClient);
            var request = new IdoitObjectInstance(idoitClient);

            //Act
            request.CmdbStatus = IdoitCmdbStatus.DEFECT;
            request.Type       = IdoitObjectTypes.PRINTER;
            request.Value      = "Printer 01";
            objID = request.Create();

            //Act:Search
            var lists = idoit.Search(request.Value);

            Assert.IsTrue(lists.Length > 0, "No objects found");
            //Assert

            foreach (var v in lists)
            {
                Assert.IsNotNull(v.link);
                Assert.IsNotNull(v.key);
                Assert.IsNotNull(v.value);
            }

            //Assert
            Assert.IsNotNull(objID);
            Assert.IsNotNull(request.Value);
            Assert.IsNotNull(request.Type);
            Assert.IsNotNull(request.CmdbStatus);

            //Act:Delete the Object
            request.ObjectId = objID;
            request.Delete();
        }