public void CreateTest() { //Arrange int objID; Client myClient = new Client(URL, APIKEY, LANGUAGE); myClient.Username = "******"; myClient.Password = "******"; Dia request = new Dia(myClient); request.property = Cpu.Type; request.value = "Athlon XP"; request.category = CategoryName.CPU; objID = request.Create(); //Assert Assert.IsNotNull(objID); Assert.IsNotNull(request.property); Assert.IsNotNull(request.value); Assert.IsNotNull(request.category); //Act:Delete the Value request.Delete(objID); }
public void UpdateTest() { //Arrange int objID; Client myClient = new Client(URL, APIKEY, LANGUAGE); myClient.Username = "******"; myClient.Password = "******"; Dia request = new Dia(myClient); List <Result[]> lists = new List <Result[]>(); //Act:Create request.property = Port.PortType; request.value = "WLAN23"; request.category = CategoryName.PORT; objID = request.Create(); //Act:Update request.property = Port.PortType; request.value = "WLAN32"; request.category = CategoryName.PORT; request.Update(objID); //Assert foreach (Result[] row in lists) { foreach (Result element in row) { Assert.IsNotNull(element.id); Assert.IsNotNull(element.title); Assert.IsNotNull(element.Const); } } //Act:Delete the Value request.Delete(objID); }
public void DeleteTest() { //Arrange int objID; Client myClient = new Client(URL, APIKEY, LANGUAGE); myClient.Username = "******"; myClient.Password = "******"; Dia request = new Dia(myClient); List <Result[]> lists = new List <Result[]>(); //Act:Create request.property = Access.Type; request.value = "ES23"; request.category = CategoryName.ACCESS; objID = request.Create(); //Act:Delete the Value request.Delete(objID); }