コード例 #1
0
        public void TestLogin()
        {
            int expected = FASTConstant.RETURN_VAL_SUCCESS;

            Repository.UnitsOfWork.GenericUnitOfWork <Registration> reg =
                new Repository.UnitsOfWork.GenericUnitOfWork <Registration>();

            Registration result = reg.Repository.GetAllQueryable().Where(m => m.EmployeeID == 114560).First();

            int actual = _userProcess.LoginUser(114560, result.Password);

            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
        public void TestRegistrationSuccess()
        {
            int expected = FASTConstant.RETURN_VAL_SUCCESS;
            int actual   = _userProcess.RegisterUser(318387);

            Assert.AreEqual(expected, actual);

            Repository.UnitsOfWork.GenericUnitOfWork <Registration> reg =
                new Repository.UnitsOfWork.GenericUnitOfWork <Registration>();

            Registration result = reg.Repository.GetAllQueryable().Where(m => m.EmployeeID == 318387).First();

            result = reg.Repository.Delete(result);
            reg.Save();
        }
コード例 #3
0
        public void TestChangePassword()
        {
            string expected     = MD5HashProvider.CreateMD5Hash("111111");
            string origPassword = MD5HashProvider.CreateMD5Hash("14560");

            Repository.UnitsOfWork.GenericUnitOfWork <Registration> reg =
                new Repository.UnitsOfWork.GenericUnitOfWork <Registration>();

            Registration result = reg.Repository.GetAllQueryable().Where(m => m.EmployeeID == 114560).First();

            int actual = _userProcess.ChangePassword(114560, expected, result.Password);


            Assert.AreEqual(FASTConstant.RETURN_VAL_SUCCESS, actual);

            _userProcess.ChangePassword(114560, origPassword, result.Password);
        }