// [Test] public void TestAddUser() { int save = 0; UserAndOrgViewModel model = new UserAndOrgViewModel(); TblOrganization org = new TblOrganization() { OrganizationId = 2, OrganizationCode = "MP", OrganizationParentCode = null, OrganizationName = "CT TNHH Minh Phúc", OrganizationAddress = "Mễ Trì, Nam Từ Liêm", OrganizationEmail = "*****@*****.**", OrganizationPhone = null, OrganizationTaxCode = null, OrganizationRemark = null, OrganizationFrom = null, CreateBy = null, CreateDate = null, UpdateBy = null, UpdateDate = Convert.ToDateTime("2019-03-03 00:00:00.000"), IsActive = false, IsLock = null, IsDelete = false, OrganizationTo = null, OrganizationHomePage = null }; // Add model model.tblUsers = GetUser(1); model.tblOrganization = org; Assert.AreEqual(save, 1); }
//[Test] public void TestEditUser() { UserAndOrgViewModel model = new UserAndOrgViewModel(); TblUsers user = new TblUsers { //Id = UserName = "******", Password = "******", FullName = "Hoang Manh Hai", Email = "*****@*****.**", PhoneNumber = "1234567890", CreateBy = "Admin", CreateDate = Convert.ToDateTime("2018-12-26T11 =53 =47.327"), UpdateBy = "", UpdateDate = Convert.ToDateTime("2019-03-29T11 =53 =00.263"), IsDelete = false, IsLock = false, Avatar = null, Address = null, LastLogin = null, Position = null, EmailConfirmed = true, Gender = 1, LoginFail = 0, HistoryPassword = "******", DateUpdatePassword = Convert.ToDateTime("2019-04-01T00 =00 =00") }; TblOrganization org = new TblOrganization() { OrganizationId = 2, OrganizationCode = "MP", OrganizationParentCode = null, OrganizationName = "CT TNHH Minh Phúc", OrganizationAddress = "Mễ Trì, Nam Từ Liêm", OrganizationEmail = "*****@*****.**", OrganizationPhone = null, OrganizationTaxCode = null, OrganizationRemark = null, OrganizationFrom = null, CreateBy = null, CreateDate = null, UpdateBy = null, UpdateDate = Convert.ToDateTime("2019-03-03 00:00:00.000"), IsActive = false, IsLock = null, IsDelete = false, OrganizationTo = null, OrganizationHomePage = null }; // Add model model.tblUsers = user; model.tblOrganization = org; //Assert.AreEqual(save, _ac.Compare(2, 1)); }