Skip to content

Add HashMap Implementation and Comprehensive Unit Tests #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

walmir-silva
Copy link
Contributor

  • Implemented the HashMap class in the KaririCode\DataStructure\Map namespace.
  • Added comprehensive unit tests for the HashMap class in the KaririCode\DataStructure\Tests\Map namespace.

Class:

  • KaririCode\DataStructure\Map\HashMap

Tests:

  • KaririCode\DataStructure\Tests\Map\HashMapTest

Implemented Features and Corresponding Tests:

  • Put method: testPutAddsKeyValuePairToMap
  • Get method: testGetReturnsValueForKey
  • Remove method: testRemoveDeletesKeyValuePairFromMap
  • Contains key method: testContainsKeyReturnsTrueIfKeyExists
  • Clear method: testClearRemovesAllKeyValuePairsFromMap
  • Keys method: testKeysReturnsAllKeysInMap
  • Values method: testValuesReturnsAllValuesInMap
  • Size method: testSizeReturnsNumberOfKeyValuePairsInMap
  • Handling null values: testHandlingNullValuesCorrectly
  • Put replaces value for existing key: testPutReplacesValueForExistingKey

- Implemented the HashMap class in the KaririCode\\DataStructure\\Map namespace.
- Added comprehensive unit tests for the HashMap class in the KaririCode\\DataStructure\\Tests\\Map namespace.

Class:
- KaririCode\\DataStructure\\Map\\HashMap

Tests:
- KaririCode\\DataStructure\\Tests\\Map\\HashMapTest

Implemented Features and Corresponding Tests:
- Put method: testPutAddsKeyValuePairToMap
- Get method: testGetReturnsValueForKey
- Remove method: testRemoveDeletesKeyValuePairFromMap
- Contains key method: testContainsKeyReturnsTrueIfKeyExists
- Clear method: testClearRemovesAllKeyValuePairsFromMap
- Keys method: testKeysReturnsAllKeysInMap
- Values method: testValuesReturnsAllValuesInMap
- Size method: testSizeReturnsNumberOfKeyValuePairsInMap
- Handling null values: testHandlingNullValuesCorrectly
- Put replaces value for existing key: testPutReplacesValueForExistingKey
@walmir-silva walmir-silva merged commit d371dae into main Jun 28, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant