Example #1
0
        public async void GetBusiness(string businessId)
        {
            this.Business = null;

            Yelp yelp = new Yelp(Config.Options);

            this.Business = await yelp.GetBusiness(businessId);
        }
        private void GetYelpData(Guid id, string yelpId)
        {
            var options = new Options
            {
                AccessToken = ConfigurationManager.AppSettings["YelpAPIToken"],
                AccessTokenSecret = ConfigurationManager.AppSettings["YelpAPITokenSecret"],
                ConsumerKey = ConfigurationManager.AppSettings["YelpAPIConsumerKey"],
                ConsumerSecret = ConfigurationManager.AppSettings["YelpAPIConsumerSecret"]
            };

            var yelp = new Yelp(options);
            Business business = yelp.GetBusiness(yelpId).Result;
            if (business != null)
                UpdateAccount(id, business.rating);
        }
Example #3
0
        public void BusinessReviewTest()
        {
            var y = new Yelp(Config.Options);
            var results = y.GetBusiness("yelp-san-francisco").Result;
            Assert.IsTrue(results != null);

            Assert.IsNotNull(results.reviews);
            Assert.AreNotEqual(0, results.review_count);

            Assert.AreNotEqual(0, results.reviews.Count);

            var firstReview = results.reviews[0];
            Assert.IsNotNull(firstReview.rating_image_url);
            Assert.IsNotNull(firstReview.rating_image_small_url);
            Assert.IsNotNull(firstReview.rating_image_large_url);
        }
Example #4
0
 public void BusinessTest()
 {
     var y = new Yelp(Config.Options);
     var results = y.GetBusiness("yelp-san-francisco").Result;
     Assert.IsTrue(results != null);
 }
Example #5
0
 public void BusinessTest()
 {
     var o = GetOptions();
     var y = new Yelp(o);
     var results = y.GetBusiness("yelp-san-francisco");
     Console.WriteLine(results);
 }
        //
        // GET: /Business/

        public ActionResult Details(string id)
        {
            Yelp y = new Yelp(Config.Options);
            var result = y.GetBusiness(id).Result;
            return View(result);
        }
Example #7
0
        public void ErrorTest_UNAVAILABLE_BUSINESS()
        {
            Yelp y = new Yelp(Config.Options);
            Business business = y.GetBusiness("foo-bar").Result;

            Assert.IsNull(business);
        }
Example #8
0
 //
 // GET: /Business/
 public ActionResult Details(string id)
 {
     Yelp y = new Yelp(MvcApplication.Options);
     var result = y.GetBusiness(id);
     return View(result);
 }