예제 #1
0
        public void TestGetProducts()
        {
            string UserName = "******";
            string Password = "******";
            string result   = WebApiCaller.GetUserToken(UserName, Password);

            Product[] products = WebApiCaller.GetProducts(result);
            Assert.IsNotNull(products);
        }
예제 #2
0
 public ActionResult ListProduct()
 {
     if (System.Web.HttpContext.Current.Session["access_token"] != null)
     {
         string    token    = (string)System.Web.HttpContext.Current.Session["access_token"];
         Product[] products = WebApiCaller.GetProducts(token);
         return(View(products));
     }
     else
     {
         return(View("ViewProduct"));
     }
 }