public void TestPersonPhoneQParam() { SearchConfiguration sConfig = setDefaultSearchConfiguration(); List <Field> fields = new List <Field>(); var person = new Person(fields); SearchAPIRequest request = new SearchAPIRequest(phone: "+14152549431", requestConfiguration: sConfig); SearchAPIResponse response = request.Send(); Assert.IsTrue(response.Person != null); request = new SearchAPIRequest(phone: "14152549431", requestConfiguration: sConfig); response = request.Send(); Assert.IsTrue(response.Person != null); request = new SearchAPIRequest(phone: "+14152549431", requestConfiguration: sConfig); response = request.Send(); Assert.IsTrue(response.Person != null); request = new SearchAPIRequest(phone: "+972508915495", requestConfiguration: sConfig); response = request.Send(); Assert.IsTrue(response.PersonsCount == 0); request = new SearchAPIRequest(phone: "4152549431", requestConfiguration: sConfig); response = request.Send(); Assert.IsTrue(response.Person != null); //fields.Add(new Phone(raw: "4152549431")); //Clark Kent # //SearchAPIRequest request = new SearchAPIRequest(person: person, requestConfiguration: sConfig); //fields.Add(new Phone(countryCode: System.Convert.ToInt32(recIn.CountryCode), number: System.Convert.ToInt64(recIn.PhoneNum))); }
public void TestPersonPhonePersonSearch() { SearchConfiguration sConfig = setDefaultSearchConfiguration(); List <Field> fields = new List <Field>(); fields.Add(new Phone(countryCode: 1, number: 4152549431)); var person = new Person(fields); SearchAPIRequest request = new SearchAPIRequest(person: person, requestConfiguration: sConfig); SearchAPIResponse response = request.Send(); Assert.IsTrue(response.Person != null); fields = new List <Field>(); fields.Add(new Phone(number: 4152549431)); person = new Person(fields); request = new SearchAPIRequest(person: person, requestConfiguration: sConfig); response = request.Send(); Assert.IsTrue(response.Person != null); fields = new List <Field>(); fields.Add(new Phone(countryCode: 34, number: 636117049)); person = new Person(fields); request = new SearchAPIRequest(person: person, requestConfiguration: sConfig); response = request.Send(); Assert.IsTrue(response.PersonsCount >= 0); }
public void TestPersonPhonePersonSearchNull() { SearchConfiguration sConfig = setDefaultSearchConfiguration(); List <Field> fields = new List <Field>(); fields = new List <Field>(); fields.Add(new Phone(countryCode: null, number: 636117049)); var person = new Person(fields); SearchAPIRequest request = new SearchAPIRequest(person: person, requestConfiguration: sConfig); request = new SearchAPIRequest(person: person, requestConfiguration: sConfig); SearchAPIResponse response; try { response = request.Send(); Assert.IsTrue(false); //if it gets this far, it's false; } catch (SearchAPIError apiError) { Assert.IsTrue(apiError.Error == "The query does not contain any valid name/username/user_id/phone/email/address to search by"); } catch (System.Net.WebException e) { } catch (Exception e) { } }
public void TestNotTopMatch() { SearchConfiguration sConfig = setDefaultSearchConfiguration(); SearchAPIRequest s = new SearchAPIRequest(firstName: "Moshe", lastName: "Elkayam", requestConfiguration: sConfig); SearchAPIResponse res = s.Send(); Assert.IsFalse(res.TopMatch); }
public void TestNotTopMatch() { SearchConfiguration config = new SearchConfiguration(apiKey: API_KEY); SearchAPIRequest s = new SearchAPIRequest(firstName: "Moshe", lastName: "Elkayam", requestConfiguration: config); SearchAPIResponse res = s.Send(); Assert.IsFalse(res.TopMatch); }