public void TestGetProducts() { string UserName = "******"; string Password = "******"; string result = WebApiCaller.GetUserToken(UserName, Password); Product[] products = WebApiCaller.GetProducts(result); Assert.IsNotNull(products); }
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")); } }