Skip to content
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

Add ArrayStack Implementation and Comprehensive Unit Tests #5

Merged
merged 1 commit into from
Jun 29, 2024

Conversation

walmir-silva
Copy link
Contributor

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

Class:

  • KaririCode\DataStructure\Stack\ArrayStack

Tests:

  • KaririCode\DataStructure\Tests\Stack\ArrayStackTest

Implemented Features and Corresponding Tests:

  • Push method: testPushAddsElementToStack
  • Pop method: testPopRemovesElementFromStack
  • Pop from empty stack: testPopFromEmptyStackReturnsNull
  • Peek method: testPeekReturnsElementFromTopWithoutRemovingIt
  • Peek from empty stack: testPeekFromEmptyStackReturnsNull
  • Is empty method: testIsEmptyReturnsTrueIfStackIsEmpty
  • Size method: testSizeReturnsNumberOfElementsInStack
  • Clear method: testClearRemovesAllElementsFromStack
  • Get items method: testGetItemsReturnsAllElementsInStack
  • Various data types: testStackWithVariousDataTypes
  • Mixed operations: testStackBehaviorAfterMixedOperations
  • LIFO behavior: testStackFollowsLifoOrder

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

Class:
- KaririCode\DataStructure\Stack\ArrayStack

Tests:
- KaririCode\DataStructure\Tests\Stack\ArrayStackTest

Implemented Features and Corresponding Tests:
- Push method: testPushAddsElementToStack
- Pop method: testPopRemovesElementFromStack
- Pop from empty stack: testPopFromEmptyStackReturnsNull
- Peek method: testPeekReturnsElementFromTopWithoutRemovingIt
- Peek from empty stack: testPeekFromEmptyStackReturnsNull
- Is empty method: testIsEmptyReturnsTrueIfStackIsEmpty
- Size method: testSizeReturnsNumberOfElementsInStack
- Clear method: testClearRemovesAllElementsFromStack
- Get items method: testGetItemsReturnsAllElementsInStack
- Various data types: testStackWithVariousDataTypes
- Mixed operations: testStackBehaviorAfterMixedOperations
- LIFO behavior: testStackFollowsLifoOrder
@walmir-silva walmir-silva merged commit 0f45efa into main Jun 29, 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