Ejemplo n.º 1
0
        public ActionResult Register(string username, string userpass)
        {
            DataAnalytics.Models.User user = new DataAnalytics.Models.User();
            user.UserName = username;
            user.UserPass = userpass;
            UserBusiness userBusiness = new UserBusiness();
            int          res          = userBusiness.Register(user);
            var          jsonObject   = new
            {
                code = res
            };

            //return Json(historics, JsonRequestBehavior.AllowGet);

            return(Json(jsonObject));
        }
Ejemplo n.º 2
0
        public void TestRegister()
        {
            DataAnalytics.Models.User user = new DataAnalytics.Models.User();
            user.UserName = "******";
            user.UserPass = "******";
            UserBusiness userBusiness = new UserBusiness();

            try
            {
                int res = userBusiness.Register(user);
                Assert.IsTrue(res == 1);
            }
            catch (Exception ex)
            {
                //Assert.IsInstanceOfType(ex, typeof(DemoException));
            }
        }
Ejemplo n.º 3
0
        public void Testlogin()
        {
            DataAnalytics.Models.User user = new DataAnalytics.Models.User();
            user.UserName = "******";
            user.UserPass = "******";
            UserBusiness userBusiness = new UserBusiness();

            try
            {
                int res = userBusiness.Login(user);
                Assert.IsTrue(res == 1);
            }
            catch (Exception ex)
            {
                //Assert.IsInstanceOfType(ex, typeof(DemoException));
            }
        }