Esempio n. 1
0
        // Wrapper for : https://westus.dev.cognitive.microsoft.com/docs/services/TextAnalytics.V2.0/operations/56f30ceeeda5650db055a3c9
        public static async Task <double> Perform(string message)
        {
            var request = new {
                documents = new[] {
                    new {
                        language = "en",
                        id       = Guid.NewGuid().ToString(),
                        text     = message
                    }
                }
            };

            dynamic result = await RESTOperations.POST(URL, request, new Dictionary <string, string>() {
                { "Ocp-Apim-Subscription-Key", apiKey }
            });

            return(result.documents[0].score);
        }
        public void ThenIGetUserListInTheGivenPage(Table table)
        {
            var userdetails = table.CreateInstance <UserInformation>();

            RESTOperations.AssertResponseContainsExpectedResult(restResponse, userdetails.page);
        }
        public void WhenIRequestOrAllUsersInAPage(Table table)
        {
            var userdetails = table.CreateInstance <UserInformation>();

            restResponse = RESTOperations.GetListOfUsers(userdetails.page);
        }
        public void GivenIHaveTheBaseUrl(Table table)
        {
            var userdetails = table.CreateInstance <UserInformation>();

            restClient = RESTOperations.SetRestClient(userdetails.url);
        }
Esempio n. 5
0
        public void ThenTheServerReturnsTheResponseWithTheCityInformation(Table table)
        {
            var cityinfo = table.CreateInstance <CityInformation>();

            RESTOperations.AssertResponseContainsExpectedResult(restResponse, cityinfo.city);
        }
Esempio n. 6
0
        public void WhenIRequestTheCityInformationUsingZipcode(Table table)
        {
            var cityinfo = table.CreateInstance <CityInformation>();

            restResponse = RESTOperations.GetResourceInformation(cityinfo.zipcode);
        }
Esempio n. 7
0
        public void GivenIHaveTheBaseApiForUsCities(Table table)
        {
            var cityinfo = table.CreateInstance <CityInformation>();

            restClient = RESTOperations.SetRestClient(cityinfo.url);
        }