本文整理汇总了C#中IO.Swagger.Api.PetApi.GetPetByIdAsync方法的典型用法代码示例。如果您正苦于以下问题:C# PetApi.GetPetByIdAsync方法的具体用法?C# PetApi.GetPetByIdAsync怎么用?C# PetApi.GetPetByIdAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IO.Swagger.Api.PetApi
的用法示例。
在下文中一共展示了PetApi.GetPetByIdAsync方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestGetPetByIdAsync
public void TestGetPetByIdAsync ()
{
PetApi petApi = new PetApi ();
var task = petApi.GetPetByIdAsync (petId);
Pet response = task.Result;
Assert.IsInstanceOf<Pet> (response, "Response is a Pet");
Assert.AreEqual ("Csharp test", response.Name);
Assert.AreEqual ("available", response.Status);
Assert.IsInstanceOf<List<Tag>> (response.Tags, "Response.Tags is a Array");
Assert.AreEqual (petId, response.Tags [0].Id);
Assert.AreEqual ("sample tag name1", response.Tags [0].Name);
Assert.IsInstanceOf<List<String>> (response.PhotoUrls, "Response.PhotoUrls is a Array");
Assert.AreEqual ("sample photoUrls", response.PhotoUrls [0]);
Assert.IsInstanceOf<Category> (response.Category, "Response.Category is a Category");
Assert.AreEqual (56, response.Category.Id);
Assert.AreEqual ("sample category name2", response.Category.Name);
}