public UpdatePetWithForm ( long petId, string name = null, string status = null ) : void | ||
petId | long | ID of pet that needs to be updated |
name | string | Updated name of the pet (optional) |
status | string | Updated status of the pet (optional) |
return | void |
public void TestUpdatePetWithForm() { PetApi petApi = new PetApi (); petApi.UpdatePetWithForm (petId.ToString(), "new form name", "pending"); Pet response = petApi.GetPetById (petId); Assert.IsInstanceOf<Pet> (response, "Response is a Pet"); Assert.IsInstanceOf<Category> (response.Category, "Response.Category is a Category"); Assert.IsInstanceOf<List<Tag>> (response.Tags, "Response.Tags is a Array"); Assert.AreEqual ("new form name", response.Name); Assert.AreEqual ("pending", response.Status); Assert.AreEqual (petId, response.Tags [0].Id); Assert.AreEqual (56, response.Category.Id); }
public void UpdatePetWithFormTest() { PetApi petApi = new PetApi (); petApi.UpdatePetWithForm (petId, "new form name", "pending"); Pet response = petApi.GetPetById (petId); Assert.IsInstanceOfType(typeof(Pet), response, "Response is a Pet"); Assert.IsInstanceOfType(typeof(Category), response.Category, "Response.Category is a Category"); Assert.IsInstanceOfType(typeof(List<Tag>), response.Tags, "Response.Tags is a Array"); Assert.AreEqual ("new form name", response.Name); Assert.AreEqual (Pet.StatusEnum.Pending, response.Status); Assert.AreEqual (petId, response.Tags [0].Id); Assert.AreEqual (56, response.Category.Id); // test optional parameter petApi.UpdatePetWithForm (petId, "new form name2"); Pet response2 = petApi.GetPetById (petId); Assert.AreEqual ("new form name2", response2.Name); }