示例#1
0
        public void UserManagementServiceUT_MakeTempPerm_ChangeTempToPermSuccess(bool isTemp, string username, string name, string email,
                                                                                 string phoneNumber, string password, int disabled, string userType, string salt)
        {
            // Arrange: Create a temporary user to be deleted.
            bool createResult = UserManagementServiceUT.CreateUser(isTemp, username, name, email, phoneNumber, password, disabled, userType, salt);

            Assert.IsTrue(createResult);

            // Act: Make the temporary user perm
            bool result = UserManagementServiceUT.MakeTempPerm(username);

            Assert.IsTrue(result);

            // Assert: that the user is infact permanent.
            UserObject user = UserManagementServiceUT.GetUserInfo(username);

            bool readResult;

            // TempTimestamp == 0 when the user is permanent.
            if (user.TempTimestamp == 0 && user.Username == username && user.Name == name && user.Email == email &&
                user.PhoneNumber == phoneNumber && user.Password == password && user.Disabled == disabled && user.UserType == userType && user.Salt == salt)
            {
                readResult = true;
            }
            else
            {
                readResult = false;
            }
            Assert.IsTrue(readResult);

            // Cleanup: Delete that user
            bool deleteResult = UserManagementServiceUT.DeleteUser(username);

            Assert.IsTrue(deleteResult);
        }