Exemplo n.º 1
0
        public void ThenThePetIsNowPresentInTheShelterWithName(string expectedName)
        {
            restClient = new RestClient();
            request    = new RestRequest("https://petstore.swagger.io/v2/pet/" + addNewPet.id);
            request.AddHeader("Content-Type", "application/json");
            request.AddHeader("Accept", "*/*");
            response = restClient.Get(request);

            AddNewPet Pets = AddNewPet.Deserialize(response);

            Assert.AreEqual(200, (int)response.StatusCode);
            Assert.IsFalse(response.Content.Contains("error") || response.Content.Contains("Pet not found"));

            string petResponse = response.Content.Substring(6, 5);

            if (petResponse == addNewPet.id.ToString() && Pets.category.name == expectedName)
            {
                result = true;
            }
            Assert.AreEqual(true, result);
        }
Exemplo n.º 2
0
 public void GivenIMGonnaCreateAPetWithPetNameTypeNamePhotoUrlsAndStatus(string PetName, string TypeName, string photoUrls, string status)
 {
     addNewPet = new AddNewPet(PetName, TypeName, status);
 }