public void FetchListTest() { SearchRequestService service = new SearchRequestService(); ItemSearchCriteriaTestHelper criteriaTestHelper = new ItemSearchCriteriaTestHelper(); ItemSearchCriteria criteria = criteriaTestHelper.GetTestEntity(); IEnumerable<AmazonItem> list = service.FetchList(criteria); Assert.IsNotNull(list); }
static void Main() { SearchRequestService request = new SearchRequestService(); ItemSearchCriteria criteria1 = new ItemSearchCriteria { SearchIndexLookupId = (int)SearchIndexLookupId.SportingGoods, ResponseTypeLookupId = new List<int> { (int)ResponseTypeLookupId.Large }, Keywords = new List<string> { "Pearl" }, }; ItemSearchCriteria criteria2 = new ItemSearchCriteria { SearchIndexLookupId = (int)SearchIndexLookupId.Video, ResponseTypeLookupId = new List<int> { (int)ResponseTypeLookupId.Large }, Keywords = new List<string> { "Star Wars" }, }; ItemSearchCriteria criteria3 = new ItemSearchCriteria { SearchIndexLookupId = (int)SearchIndexLookupId.Tools, ResponseTypeLookupId = new List<int> { (int)ResponseTypeLookupId.Large }, Keywords = new List<string> { "Hide-a-Spare-Key Fake Rock " }, }; IEnumerable<AmazonItem> list = request.FetchList(criteria2); foreach (AmazonItem item in list) { Console.WriteLine("Title: " + item.Title); Console.WriteLine("Price: " + item.Price); //string test = item.DetailPageURL; //Price test2 = item.ItemAttributes.ListPrice; Console.Write(Environment.NewLine); } Console.WriteLine(Environment.NewLine + "done...enter any key to continue>"); Console.ReadKey(); }