public IRestResponse SearchAsString(ConsumerViewQuery query, ConsumerViewQuery.ResponseFormat format) { IRestResponse response = new RestResponse(); try { response = Client.Setup(Configuration).Execute(query.CreateRequest(format)); } catch (Exception e) { LogException(CreateParameters(query), e); throw; } return response; }
public IRestResponse<ConsumerViewResponse> Search(ConsumerViewQuery query) { IRestResponse<ConsumerViewResponse> response = new RestResponse<ConsumerViewResponse>(); try { response = Client.Setup(Configuration).Execute<ConsumerViewResponse>(query.CreateRequest()); } catch (Exception e) { LogException(CreateParameters(query), e); throw; } return response; }
public when_creating_idnum_query() { query = new ConsumerViewQuery(Constants.SearchID); }
public override void Observe() { var query = new ConsumerViewQuery("4810100045085"); // example query response = service.Search(query); }
private static string CreateSubCategory(ConsumerViewQuery query) { return !string.IsNullOrEmpty(query.IdNumber) ? "IdNumber" : !string.IsNullOrEmpty(query.PhoneNumber) ? "PhoneNumber" : !string.IsNullOrEmpty(query.EmailAddress) ? "EmailAddress" : "Unknowm"; }
private static string CreateParameters(ConsumerViewQuery query) { return string.Format("ID Number: {0}, Phone number: {1}, Email address: {2}", query.IdNumber, query.PhoneNumber, query.EmailAddress); }
public when_creating_email_query() { _query = new ConsumerViewQuery("", "", Constants.SearchEmail); }
public when_creating_phone_query() { query = new ConsumerViewQuery("",Constants.SearchPhone,""); }
public override void Observe() { //var query = new ConsumerViewQuery { IdNumber = "4810100045085" }; // live example var query = new ConsumerViewQuery("4810100045085"); // live example response = service.Search(query); }
public when_creating_combined_query_to_search() { query = new ConsumerViewQuery(Constants.SearchID, Constants.SearchPhone, Constants.SearchEmail); }