Пример #1
0
        public void BuildSearchRequestQuery()
        {
            //Arrange
            IApiRequestBuilder builder = new ApiRequestBuilder();
            SearchRequestInput request = new SearchRequestInput
            {
                query = "Ben & Jerry's ice cream",
                sort  = SearchRequestSortType.bestseller
            };

            //Act
            var result = builder.GetSearchApiQueryString(request, "test");

            //Assert
            var expectedValue = @"apiKey=test&query=Ben+%26+Jerry%27s+ice+cream&numItems=10&sort=bestseller&categoryId=0&responseGroup=base";

            Assert.Equal(expectedValue, result);
        }