示例#1
0
        public void UserManagementServiceUT_CheckUserExistence_UserDoesNotExistsFailure(string username)
        {
            // Assert: Check that an non existing user returns false.
            bool result = UserManagementServiceUT.CheckUserExistence(username);

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

            Assert.IsTrue(createResult);

            // Act: Delete the user
            bool result = UserManagementServiceUT.DeleteUser(username);

            Assert.IsTrue(result);

            // Assert: that the user is properly deleted from the table with CheckUserExistence
            bool existResult = UserManagementServiceUT.CheckUserExistence(username);

            Assert.IsFalse(existResult);
        }
示例#3
0
        public void UserManagementServiceUT_CheckUserExistence_UserExistsSuccess(bool isTemp, string username, string name, string email,
                                                                                 string phoneNumber, string password, int isDisabled, string userType, string salt)
        {
            // Arrange: Create user
            bool createResult = UserManagementServiceUT.CreateUser(isTemp, username, name, email, phoneNumber, password, isDisabled, userType, salt);

            Assert.IsTrue(createResult);


            // Assert: Check that an existing user returns true.
            bool result = UserManagementServiceUT.CheckUserExistence(username);

            Assert.IsTrue(result);

            // Cleanup: delete the created user.
            bool deleteResult = UserManagementServiceUT.DeleteUser(username);

            Assert.IsTrue(deleteResult);
        }