コード例 #1
0
        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)));
        }
コード例 #2
0
        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);
        }
コード例 #3
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)
            { }
        }
コード例 #4
0
        public void TestNotTopMatch()
        {
            SearchConfiguration sConfig = setDefaultSearchConfiguration();
            SearchAPIRequest    s       = new SearchAPIRequest(firstName: "Moshe", lastName: "Elkayam", requestConfiguration: sConfig);
            SearchAPIResponse   res     = s.Send();

            Assert.IsFalse(res.TopMatch);
        }
コード例 #5
0
ファイル: UnitTest1.cs プロジェクト: piplcom/piplapis-csharp
        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);
        }