/// <summary> /// It returns the list of seach options supported by each payer. /// API: https://gds.eligibleapi.com/v1.5/payers/search_options /// </summary> /// <returns>List of EligibleService.Model.PayerSearchOption</returns> public PayersSearchOptionResponse SearchOptions(RequestOptions options = null) { response = ExecuteObj.Execute(EligibleResources.PathToPayerSearchOptions, SetRequestOptionsObject(options)); PayersSearchOptionResponse payersSearchOptionResponse = new PayersSearchOptionResponse(); var formattedResponse = RequestProcess.SimpleResponseValidation <Collection <PayerSearchOptions> >(response); payersSearchOptionResponse.SearchOptionsList = formattedResponse; payersSearchOptionResponse.SetJsonResponse(response.Content); return(payersSearchOptionResponse); }
public void SearchOptionsTest() { restClient.Setup(x => x.Execute(It.IsAny <string>(), It.IsAny <RequestOptions>(), It.IsAny <Hashtable>())) .Returns(new RestResponse() { StatusCode = HttpStatusCode.OK, Content = TestHelper.GetJson(TestResource.MocksPath + "SearchOptions.json") }); payers.ExecuteObj = restClient.Object; PayersSearchOptionResponse searchOptions = payers.SearchOptions(); Collection <PayerSearchOptionResponse> expectedSearchOptions = SearchOptionsExpectedResults.GetExpectedSearchOption(); Assert.IsNotNull(searchOptions); Assert.AreEqual(expectedSearchOptions.Count, searchOptions.SearchOptionsList.Count); Assert.AreEqual(expectedSearchOptions[0].PayerId, searchOptions.SearchOptionsList[0].PayerId); Assert.AreEqual(expectedSearchOptions[0].SearchOptions.Count, searchOptions.SearchOptionsList[0].SearchOptions.Count); }