Example #1
0
        public VOUser GetUser()
        {
            Utility.CheckAuthentication(() => DAL.GetUser(user.Token), (res) =>
            {
                var keyValue = JsonConvert.DeserializeObject <VOUser>(res.Content.ReadAsStringAsync().Result);

                user.Status = keyValue.Status;
                user.Role   = keyValue.Role;
                user.Id     = keyValue.Id;
            }, this);

            return(user);
        }
Example #2
0
 public void TestCase()
 {
     Assert.Inconclusive();
     try
     {
         var result = dal.GetUser("token");
         Assert.IsNotNull(result);
     }
     catch (Exception ex)
     {
         if (ex.InnerException.GetType() == typeof(WebException) &&
             ((WebException)ex.InnerException).Status.ToString() == "ConnectFailure")
         {
             Assert.Fail();
         }
     }
 }