예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }