BHAL Project Home Page / Documentation / Test Cases / Authentication and Autorization / User Management Test Cases
This page details the test cases for the User Management functionality.
Classes Tested
Code Coverage Results
Test Case #1 - Create a New User
Test that creates a new user.
Starts with: User Management form shown to the user.
Actions:
- Changes the view properties to the desired values.
- Raises the SaveUser event so the presenter gets notified.
- After the presenter has saved the user, asserts that the user got saved correctly by checking values on the database.
Ends with: New user created.
Implemented in: Namespace Bhal.Testing.MVP.Security and unit test UserManagementTests.TestCreateUser.
Test Case #2 - Select a User
Tests the selection of a pre-existing user for edition.
Starts with: User Management form shown to the user.
Actions:
- Changes the view properties to the desired values.
- Raises the SaveUser event so the presenter gets notified.
- After the presenter has saved the user, changes the selected user property of the view to the created user.
- Raise the UserSelectedEvent passing the created user in the event args.
- Asserts that the correct user got selected.
- Assert in the database that the user is correct.
Ends with: User selected and his info loaded in the view.
Implemented in: Namespace Bhal.Testing.MVP.Security and unit test UserManagementTests.TestSelectUser.
Test Case #3 - Update a User
Test updating data of the selected user.
Starts with: User Management form shown to the user.
Actions:
- Changes the view properties to the desired values.
- Raises the SaveUser event so the presenter gets notified.
- After the presenter has saved the user, changes the selected user property of the view to the created user.
- Raise the UserSelectedEvent passing the created user in the event args.
- Changes the desired view properties to alternate values.
- Raises the SaveUser event so the presenter gets notified.
- After the presenter has saved the user, asserts that the user got saved correctly by checking values on the database.
Ends with: User selected, updated and his info loaded in the view.
Implemented in: Namespace Bhal.Testing.MVP.Security and unit test UserManagementTests.TestUpdateUser.
Test Case #4 - Create a new User and Cancel
Test Creating a new user, but before saving canceling the update.
The view must be empty.
Starts with: User Management form shown to the user.
Actions:
- Changes the view properties to the desired values.
- Raises the CancelEdit event so the presenter gets notified.
- After the presenter has reset the view, asserts that the view is empty.
Ends with: Empty view, despite the changes made before cancelling the creation.
Implemented in: Namespace Bhal.Testing.MVP.Security and unit test UserManagementTests.TestCreateNewAndCancel.
Test Case #5 - Update a User and Cancel
Test Updating an user, but before saving cancel the update.
The original information of the user must be restored.
Starts with: User Management form shown to the user.
Actions:
- Changes the view properties to the desired values.
- Raises the SaveUser event so the presenter gets notified.
- After the presenter has saved the user, changes the selected user property of the view to the created user.
- Raise the UserSelectedEvent passing the created user in the event args.
- Changes the desired view properties to alternate values.
- Raises the CancelEdit event so the presenter gets notified.
- After the presenter has reset the view, asserts that the view data is that of the user in the database.
Ends with: Selected user info loaded in the view, despite the changes made before cancelling the update.
Implemented in: Namespace Bhal.Testing.MVP.Security and unit test UserManagementTests.TestUpdateAndCancel.
Test Case #6 - Save User with empty username
Test Creating a new user with empty username.
Starts with: User Management form shown to the user.
Actions:
- Changes the view properties to the desired values with an empty username.
- Raises the SaveUser event so the presenter gets notified.
- Catches the InvalidOperationException.
Ends with: Exception.
Implemented in: Namespace Bhal.Testing.MVP.Security and unit test UserManagementTests.TestSaveEmptyUserName.
Test Case #7 - Save a new user with empty e-mail
Test Creating a new user with empty e-mail.
Starts with: User Management form shown to the user.
Actions:
- Changes the view properties to the desired values with an empty e-mail.
- Raises the SaveUser event so the presenter gets notified.
- Catches the InvalidOperationException.
Ends with: Exception.
Implemented in: Namespace Bhal.Testing.MVP.Security and unit test UserManagementTests.TestSaveEmptyEmail.
Test Case #8 - Save a new user with no roles
Test Creating a new user with no roles.
Starts with: User Management form shown to the user.
Actions:
- Changes the view properties to the desired values with no roles.
- Raises the SaveUser event so the presenter gets notified.
- Catches the InvalidOperationException.
Ends with: Exception.
Implemented in: Namespace Bhal.Testing.MVP.Security and unit test UserManagementTests.TestSaveUserWithNoRoles.
Test Case #9 - Save a new user with the same username as an existing user
Test Creating a new user with the same username as an existing user.
Starts with: User Management form shown to the user.
Actions:
- Changes the view properties to the desired values with the same username as an existing user.
- Raises the SaveUser event so the presenter gets notified.
- Catches the InvalidOperationException.
Ends with: Exception.
Implemented in: Namespace Bhal.Testing.MVP.Security and unit test UserManagementTests.TestSaveUserWithSameUserNameAsExistingOne.
Test Case #10 - Save a new user with the same e-mail as an existing user
Test Creating a new user with the same e-mail as an existing user.
Starts with: User Management form shown to the user.
Actions:
- Changes the view properties to the desired values with the same e-mail as an existing user.
- Raises the SaveUser event so the presenter gets notified.
- Catches the InvalidOperationException.
Ends with: Exception.
Implemented in: Namespace Bhal.Testing.MVP.Security and unit test UserManagementTests.TestSaveUserWithSameEmailAsExistingOne.
Test Case #11 - Updates an user´s e-mail to that of an existing user
Test updating an user´s e-mail to that of an existing user.
Starts with: User Management form shown to the user.
Actions:
- Changes the view properties to the desired values.
- Raises the SaveUser event so the presenter gets notified.
- After the presenter has saved the user, changes the selected user property of the view to the created user.
- Raise the UserSelectedEvent passing the created user in the event args.
- Changes the desired view properties to alternate values with the same e-mail as an existing user.
- Raises the SaveUser event so the presenter gets notified.
- Catches the InvalidOperationException.
Ends with: Exception.
Implemented in: Namespace Bhal.Testing.MVP.Security and unit test UserManagementTests.TestUpdateUserToExistingEmail.
Comments (0)
You don't have permission to comment on this page.