public void ItShouldPrintAHumanReadableBusinessQuery()
        {
            var q = new BusinessQuery("Whitepages") {City = "Seattle", StateCode = "WA"};

            var s = q.ToString();
            Console.Out.WriteLine(s);

            Assert.IsTrue(s.StartsWith("BusinessQuery"));
            Assert.IsTrue(s.Contains("Whitepages"));
            Assert.IsTrue(s.Contains("Seattle"));
            Assert.IsTrue(s.Contains("WA"));
        }
        static void Main(string[] args)
        {
            var apiKey = ExampleUtils.GetApiKey(args);
            var client = new Client(apiKey);
            var query = new BusinessQuery
            {
                Name = Name,
                City = City,
                StateCode = StateCode,
                PostalCode = PostalCode,
            };

            Response<IBusiness> response = null;
            try
            {
                response = client.FindBusinesses(query);

            }
            catch (FindException)
            {
                Console.Out.WriteLine("FindBusiness lookup for {0}; {1}; {2}; {3} failed!", Name, City, StateCode, PostalCode);
            }

            if ((response != null) && (response.IsSuccess))
            {
                var results = response.Results;
                Console.Out.WriteLine(
                    "FindBusiness lookup for {0}; {1}; {2}; {3} was successful, returning {4} root business objects{5}{5}",
                    Name, City, StateCode, PostalCode, results.Count, System.Environment.NewLine);

                foreach (var business in results)
                {
                    ExampleUtils.DumpBusiness(business, 2);
                    Console.Out.WriteLine();
                }
            }

            #if DEBUG
            System.Console.Out.WriteLine("Press the ENTER key to quit...");
            System.Console.In.ReadLine();
            #endif
        }
 /// <summary>
 /// Executes the given query and returns the response.
 /// </summary>
 /// <param name="query">The query to perform</param>
 /// <returns>The response object</returns>
 public virtual Response<IBusiness> FindBusinesses(BusinessQuery query)
 {
     return _businessResultFinder.Find(query, this);
 }
            public override Response<IBusiness> FindBusinesses(BusinessQuery query)
            {
                if (this.ForceErrorResult)
                {
                    throw new FindException("Stubbed client always errors!");
                }

                var results = new List<IBusiness>();
                if (!this.ForceEmptyResult)
                {
                    results.Add(_business);
                }
                return new Response<IBusiness>(this, results, GetDictionary(this), _emptyMessages);
            }