public void AddSystemUserTest() { BusinessComponent target = new BusinessComponent(); SystemUser sysUser = null; bool expected = false; bool actual; actual = target.AddSystemUser(sysUser); Assert.AreEqual(expected, actual); sysUser = new SystemUser { LoginName = "gh", UserID = Guid.NewGuid(), Port = 11, UserState = 1, IPAddress = "127.0.0.1" }; expected = true; actual = target.AddSystemUser(sysUser); Assert.AreEqual(expected, actual); actual = SystemUser.DeleteSystemUser(sysUser); Assert.AreEqual(expected, actual); }
public void UpdateSystemUserTest() { BusinessComponent target = new BusinessComponent(); SystemUser sysUser = new SystemUser { LoginName = "gh", UserID = Guid.NewGuid(), Port = 11, UserState = 1, IPAddress = "127.0.0.1" }; target.AddSystemUser(sysUser); bool expected = true; bool actual; sysUser.Port = 12; actual = target.UpdateSystemUser(); Assert.AreEqual(expected, actual); Assert.AreEqual(12, SystemUser.GetSystemUserByLoginName("gh").Port); target.DeleteSystemUser(sysUser); }
public void GetSystemUserByLoginNameTest() { BusinessComponent target = new BusinessComponent(); SystemUser sysUser = new SystemUser { LoginName = "gh", UserID = Guid.NewGuid(), Port = 11, UserState = 1, IPAddress = "127.0.0.1" }; target.AddSystemUser(sysUser); string loginName = "gh"; SystemUser expected = sysUser; SystemUser actual; actual = target.GetSystemUserByLoginName(loginName); Assert.AreEqual(expected, actual); target.DeleteSystemUser(sysUser); }