Example #1
0
        public static void PhoneIdStandard(string[] args)
        {
            CheckArgument.ArrayLengthIs(args, 1, "args");
            string phoneNumber = args[0];

            PhoneIdService          service  = new PhoneIdService(GetConfiguration());
            PhoneIdStandardResponse response = service.StandardLookup(phoneNumber);
        }
Example #2
0
        public static void PhoneIdScore(string[] args)
        {
            CheckArgument.ArrayLengthIs(args, 1, "args");
            string phoneNumber = args[0];

            PhoneIdService       service  = new PhoneIdService(GetConfiguration());
            PhoneIdScoreResponse response = service.ScoreLookup(phoneNumber);

            Console.WriteLine("Phone Number: {0}", phoneNumber);
            Console.WriteLine("Risk        : {0} [{1}] - Recommend {2}", response.Risk.Level, response.Risk.Score, response.Risk.Recommendation);
        }
Example #3
0
        public static void PhoneIdContact(string[] args)
        {
            CheckArgument.ArrayLengthIs(args, 1, "args");
            string phoneNumber = args[0];

            PhoneIdService         service  = new PhoneIdService(GetConfiguration());
            PhoneIdContactResponse response = service.ContactLookup(phoneNumber);

            Console.WriteLine("Phone Number: {0}", phoneNumber);
            Console.WriteLine("Name        : {0}", response.Contact.FullName);
            Console.WriteLine("Address     :\r\n{0}", response.Contact.GetFullAddress());
        }
        public void TestPhoneIdScoreWrapsParserErrors()
        {
            string message = "My exception message";
            IPhoneIdResponseParser parser = new FakeResponseParser()
            {
                ExpectedException = new Exception(message),
            };

            PhoneIdService service = this.CreateService(null, parser);

            Assert.Throws <ResponseParseException>(delegate
            {
                service.ScoreLookup("15555555555");
            });
        }
Example #5
0
        public static void MapRegistrationLocation(string[] args)
        {
            CheckArgument.ArrayLengthIs(args, 1, "args");
            string phoneNumber = args[0];

            PhoneIdService          service  = new PhoneIdService(GetConfiguration());
            PhoneIdStandardResponse response = service.StandardLookup(phoneNumber);

            string url = string.Format(
                "http://maps.google.com/maps?q={0},{1}",
                response.Location.Coordinates.Latitude,
                response.Location.Coordinates.Longitude);

            Process.Start(url);
        }
Example #6
0
        public static void MapContactLocation(string[] args)
        {
            CheckArgument.ArrayLengthIs(args, 1, "args");
            string phoneNumber = args[0];

            PhoneIdService         service  = new PhoneIdService(GetConfiguration());
            PhoneIdContactResponse response = service.ContactLookup(phoneNumber);

            string address = response.Contact.GetFullAddressOnSingleLine();

            Console.WriteLine("Google Mapping: {0}", address);

            string url = string.Format(
                "http://maps.google.com/maps?q={0}",
                address);

            Process.Start(url);
        }
Example #7
0
        public static void PhoneIdLive(string[] args)
        {
            CheckArgument.ArrayLengthIs(args, 1, "args");
            string phoneNumber = args[0];

            PhoneIdService      service  = new PhoneIdService(GetConfiguration());
            PhoneIdLiveResponse response = service.LiveLookup(phoneNumber);

            Console.WriteLine("Phone Number      : {0}", phoneNumber);
            Console.WriteLine("Subscriber Status : {0}", response.Live.SubscriberStatus);
            Console.WriteLine("Device            : {0}", response.Live.DeviceStatus);
            Console.Write("Roaming           : {0}", response.Live.Roaming);

            if (string.IsNullOrEmpty(response.Live.RoamingCountry))
            {
                Console.WriteLine();
            }
            else
            {
                Console.WriteLine(" in {0}", response.Live.RoamingCountry);
            }
        }