public void TestMethod3() { List <UserInfo> userList = userInfoDal.GetAll(); int result = userList.Count; Assert.AreEqual(3, result); }
/// <summary> /// 验证登录信息 /// </summary> /// <param name="role">用户信息</param> /// <returns>是否登录成功</returns> public bool Login(Role role, UserInfo user) { UserInfoDal userInfoDal = new UserInfoDal(); List <UserInfo> userList = userInfoDal.GetAll(); if (userInfoDal.IsExist(user.nickName))//登录前检测是否存在该用户名 { return(false); } foreach (UserInfo userInfo in userList) { if (userInfo.nickName == user.nickName) { user = userInfo; break; } } role.id = user.userId; role.isAdmin = false; return(new RoleDal().IsExist(role)); }
/// <summary> /// 获取记录 /// </summary> /// <returns></returns> public DataTable GetAll() { return(_dal.GetAll()); }