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(); }
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(); }
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(); }
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(); }