Beispiel #1
0
        public void validateSpecificItem(string id)
        {
            string uriReq = new OmdbUriRequest.OmdbRequestBuilder(OmdbTerms.ID, id)
                            .Build()
                            .ToString();
            string request = ApiServiceManager.GetSpecificValueFromJsonResponse(AvailableApiServices.OMDB, uriReq, "imdbID");

            Assert.IsTrue(request.ToLower().Contains(id.ToLower()));
        }
        public void ValidateTextInResponse(string factID, string text)
        {
            uriRequest = new CatUriRequest.CatRequestBuilder()
                         .UsingID(factID)
                         .Build()
                         .ToString();
            string responseAsJson = ApiServiceManager.GetSpecificValueFromJsonResponse(AvailableApiServices.CAT, uriRequest, "text");

            Assert.IsTrue(responseAsJson.ToLower().Contains(text.ToLower()));
        }
        public void ValidateEntireObject(string factID)
        {
            uriRequest = new CatUriRequest.CatRequestBuilder()
                         .UsingID(factID)
                         .Build()
                         .ToString();
            string responseAsJson = ApiServiceManager.GetResponseFromUriAsJsonString(AvailableApiServices.CAT, uriRequest);

            Console.WriteLine(responseAsJson);
            Assert.IsNotNull(responseAsJson);
        }
        public void CheckIfAnimalTypeExists(string animalType)
        {
            uriRequest = new CatUriRequest.CatRequestBuilder().GetRandom()
                         .UsingAnimalType(animalType)
                         .Build()
                         .ToString();
            string request = ApiServiceManager.GetResponseFromUriAsJsonString(AvailableApiServices.CAT,
                                                                              uriRequest);

            Console.WriteLine(uriRequest + request);
            Assert.IsNotNull(request);
        }
Beispiel #5
0
        public void ValidateSeriesExists(String title)
        {
            String uriRequest = new OmdbUriRequest.OmdbRequestBuilder(OmdbTerms.TITLE, title)
                                .UsingFormat(OmdbTerms.SERIES)
                                .UsingDatatype(OmdbTerms.JSON_DATATYPE)
                                .WithPlotType(OmdbTerms.FULL_PLOT)
                                .WithPageNumber(1)
                                .Build()
                                .ToString();
            // Make request and get the answer as a JSON string
            string request = ApiServiceManager.GetSpecificValueFromJsonResponse(AvailableApiServices.OMDB, uriRequest, "Title");

            //Make sure the title matches the expected value
            Assert.IsTrue(request.ToLower().Contains(title.ToLower()));
        }