public void TestEditUser() { LbsModel.UsersInfo user = new LbsModel.UsersInfo(); user = LbsDAl.UsersInfoDataAccess.SelectByKeyWord("2013", LbsDAl.UserSelectKeyWordType.ID); bool flag = true; user.U_Nickname = "bl"; flag = LbsDAl.UsersInfoDataAccess.EditUserInfo(user); //Assert.AreEqual(flag, LbsDAl.UsersInfoDataAccess.EditUserInfo(user), "测试数据库中是否能修改用户"); Console.WriteLine(flag); }
public void TestAddUser() { bool flag = true; LbsModel.UsersInfo user = new LbsModel.UsersInfo(); user.U_ID = "2013zx"; user.U_Nickname = "zx"; user.U_Password = "******"; user.U_Phone = "12345"; user.U_Address = "zx"; user.U_Birthday = DateTime.Now.ToShortDateString(); user.U_CreateTime = DateTime.Now.ToShortTimeString(); user.U_RegisterTime = DateTime.Now.ToShortDateString(); user.U_Gender = "f"; user.U_AlterTime = DateTime.Now.ToShortDateString(); // Assert.AreEqual(flag, LbsDAl.UsersInfoDataAccess.AddUser(user), "测试数据库中是否能添加进去用户"); flag = LbsDAl.UsersInfoDataAccess.AddUser(user); Console.WriteLine(flag); Console.Read(); }