public void QuickpurgeTest() { //Arrange int cateId, objectId; Client myClient = new Client(URL, APIKEY, LANGUAGE); myClient.Username = "******"; myClient.Password = "******"; Obj objectRequest = new Obj(myClient); AccessRequset categoryRequest = new AccessRequset(); Access access = new Access(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.type = " ES"; categoryRequest.formatted_url = "https://swsan.admin.acme-it.example/"; cateId = access.Create(objectId, categoryRequest); //Act access.Quickpurge(objectId, cateId); }
public void ArchiveTestCheckIfTheObjectArchived() { //Arrange int objID; Result list = new Result(); Client myClient = new Client(URL, APIKEY, LANGUAGE); myClient.Username = "******"; myClient.Password = "******"; Obj request = new Obj(myClient); //Act:Create the Object request.type = ObjectType.ROUTER; request.title = "HQ Gateway"; request.cmdbStatus = CmdbStatus.DEFECT; objID = request.Create(); //Act:Archive the Object request.Archive(objID); //Act:Read the Object list = request.Read(objID); //Assert Assert.AreEqual("3", list.status); }
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); }
public void ReadTest() { //Arrange int objID; Result list = new Result(); Client myClient = new Client(URL, APIKEY, LANGUAGE); myClient.Username = "******"; myClient.Password = "******"; Obj request = new Obj(myClient); //Act:Create the Object request.type = ObjectType.SERVER; request.title = "Ceph Storage Pod A001 01"; request.cmdbStatus = CmdbStatus.PLANNED; objID = request.Create(); //Act:Read the Object list = request.Read(objID); //Assert Assert.AreEqual(objID, list.id); Assert.AreEqual("Ceph Storage Pod A001 01", list.title); Assert.IsNotNull(list.title); Assert.IsNotNull(list.cmdbStatus); //Act:Delete the Object request.Purge(objID); }
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); }
public void UpdateTest() { //Arrange int cateId, objectId; List <AccessResponse[]> list = new List <AccessResponse[]>(); Client myClient = new Client(URL, APIKEY, LANGUAGE); myClient.Username = "******"; myClient.Password = "******"; Obj objectRequest = new Obj(myClient); AccessRequset categoryRequest = new AccessRequset(); Access access = new Access(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.type = " ES"; categoryRequest.formatted_url = "https://swsan.admin.acme-it.example/"; cateId = access.Create(objectId, categoryRequest); //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; access.Update(objectId, categoryRequest); //Act:Read the Category categoryRequest.category_id = cateId; list = access.Read(objectId); //Assert foreach (AccessResponse[] row in list) { foreach (AccessResponse element in row) { Assert.AreEqual("Web GUI 2", categoryRequest.title); } } //Act:Delete the Object objectRequest.Delete(objectId); }
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); }
public void ReadTest() { //Arrange List <Result[]> lists = new List <Result[]>(); Client myClient = new Client(URL, APIKEY, LANGUAGE); myClient.Username = "******"; myClient.Password = "******"; ObjectsRead request = new ObjectsRead(myClient); ObjectCreate requestCreate = new ObjectCreate(myClient); Filter filter = new Filter(); int[] ObjectId = new int[10]; //Act:Create the Objects for (int i = 0; i < 10; i++) { requestCreate.type = ObjectType.SYSTEM_SERVICE; requestCreate.title = " System Service " + i; requestCreate.cmdbStatus = CmdbStatus.PLANNED; ObjectId[i] = requestCreate.Create(); } //Act : Read Objects request.limit = "0,10"; request.orderBy = OrderBy.Title; request.sort = Sort.Acsending; filter.ids = new int[] { ObjectId[0], ObjectId[8] }; filter.type = "C__OBJTYPE__SERVICE"; //filter.title = "SystemService"; lists = request.Read(filter); //Assert foreach (Result[] row in lists) { foreach (Result element in row) { Assert.IsNotNull(element.title); Assert.IsNotNull(element.id); } } //Act:Delete the Objects for (int i = 0; i < 10; i++) { requestCreate.Purge(ObjectId[i]); } }
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); }
public void CreateTest() { //Arrange int cateId, objectId; List <IPResponse[]> list = new List <IPResponse[]>(); IPRequset categoryRequest = new IPRequset(); Client myClient = new Client(URL, APIKEY, LANGUAGE); myClient.Username = "******"; myClient.Password = "******"; Obj objectRequest = new Obj(myClient); IP IP = new IP(myClient); //Act:Create the Object objectRequest.type = ObjectType.CLUSTER; objectRequest.title = " My Cluster"; objectRequest.cmdbStatus = CmdbStatus.INOPERATION; objectId = objectRequest.Create(); //Act: Create the Category categoryRequest.ipv4_address = "1.1.1.2"; categoryRequest.description = "Web GUI description"; cateId = IP.Create(objectId, categoryRequest); //Assert Assert.IsNotNull(cateId); //Act: Read the Category categoryRequest.category_id = cateId; list = IP.Read(objectId); //Assert foreach (IPResponse[] row in list) { foreach (IPResponse element in row) { Assert.IsNotNull(element.ipv4_address); Assert.IsNotNull(element.id); } } ////Act:Delete the Object objectRequest.Delete(objectId); }
public void ArchiveTest() { //Arrange int objID; Client myClient = new Client(URL, APIKEY, LANGUAGE); myClient.Username = "******"; myClient.Password = "******"; Obj request = new Obj(myClient); //Act request.type = ObjectType.PRINTER; request.title = "HQ Printer"; request.cmdbStatus = CmdbStatus.INOPERATION; objID = request.Create(); request.Archive(objID); //Assert Assert.IsNotNull(objID); }
public void DeleteTest() { //Arrange int objID; Client myClient = new Client(URL, APIKEY, LANGUAGE); myClient.Username = "******"; myClient.Password = "******"; Obj request = new Obj(myClient); //Act:Create the Object request.type = ObjectType.CLIENT; request.title = " My Client"; request.cmdbStatus = CmdbStatus.INOPERATION; objID = request.Create(); //Act:Delete the Object request.Delete(objID); //Assert Assert.IsNotNull(objID); }
public void SearchTest() { //Arrange int objID; Client myClient = new Client(URL, APIKEY, LANGUAGE); myClient.Username = "******"; myClient.Password = "******"; idoit idoit = new idoit(myClient); Obj request = new Obj(myClient); List <Search[]> lists = new List <Search[]>(); //Act request.type = ObjectType.PRINTER; request.title = "Printer 01"; request.cmdbStatus = CmdbStatus.DEFECT; objID = request.Create(); //Act:Search lists = idoit.Search(request.title); //Assert foreach (Search[] row in lists) { foreach (Search element in row) { Assert.IsNotNull(element.link); Assert.IsNotNull(element.key); Assert.IsNotNull(element.value); } } //Assert Assert.IsNotNull(objID); Assert.IsNotNull(request.title); Assert.IsNotNull(request.type); Assert.IsNotNull(request.cmdbStatus); //Act:Delete the Object request.Delete(objID); }
public void PurgeTest() { //Arrange int objID; Client myClient = new Client(URL, APIKEY, LANGUAGE); myClient.Username = "******"; myClient.Password = "******"; Obj request = new Obj(myClient); //Act:Create the Object request.type = ObjectType.MONITOR; request.title = "TFT 001"; request.cmdbStatus = CmdbStatus.STORED; objID = request.Create(); //Act:Purge the Object request.Purge(objID); //Assert Assert.IsNotNull(objID); }
public void DeleteTestCheckIfTheObjectDeleted() { //Arrange int objID; Result list = new Result(); Client myClient = new Client(URL, APIKEY, LANGUAGE); myClient.Username = "******"; myClient.Password = "******"; Obj request = new Obj(myClient); //Act:Create the Object request.type = ObjectType.CLIENT; request.title = "Laptop 001"; request.cmdbStatus = CmdbStatus.PLANNED; objID = request.Create(); //Act:Delete the Object request.Delete(objID); //Act:Read the Object list = request.Read(objID); //Assert Assert.AreEqual("4", list.status); }
public void UpdateTest() { //Arrange int objID; Result list = new Result(); Client myClient = new Client(URL, APIKEY, LANGUAGE); myClient.Username = "******"; myClient.Password = "******"; Obj request = new Obj(myClient); //Act:Create the Object request.type = ObjectType.SERVER; request.title = " Switch Colo A001 02"; request.cmdbStatus = CmdbStatus.INOPERATION; objID = request.Create(); //Act:Update the Object request.title = "Switch Colo A001 01"; request.Update(objID); //Act:Read the Object list = request.Read(objID); //Assert Assert.AreEqual("Switch Colo A001 01", list.title); }