This repository contains unit tests for an ATM Machine simulation program written in Java. The main goal of this project is to practice writing assertion cases and creating test suites. The ATM code is sourced from an existing project, while the unit tests and assertions have been written specifically for this repository.
- Account Management: Perform operations such as deposits, withdrawals, and transfers.
- ATM Interface: Run the ATM application and manage user interactions.
- Option Menu: Handle user inputs and perform account operations.
- Unit Testing: Comprehensive tests for the main classes using JUnit.
- Java Development Kit (JDK) 8 or later
- An IDE with Maven support (IntelliJ IDEA, Eclipse, etc.)
-
Using IntelliJ IDEA:
- Go to
File
>New
>Project from Version Control
. - Enter the repository URL:
https://github.com/sancakerkan/ATM-Machine-UnitTesting.git
. - Click
Clone
.
- Go to
-
Using Eclipse:
- Go to
File
>Import...
. - Select
Git
>Projects from Git
>Clone URI
. - Enter the repository URL:
https://github.com/sancakerkan/ATM-Machine-UnitTesting.git
. - Follow the prompts to complete the cloning process.
- Go to
-
OR Simply Download the ZIP file
-
Using IntelliJ IDEA:
- Open the project.
- Navigate to
src/main/java/ATM.java
. - Right-click
ATM.java
and selectRun 'ATM.main()'
.
-
Using Eclipse:
- Open the project.
- Navigate to
src/main/java/ATM.java
. - Right-click
ATM.java
and selectRun As
>Java Application
.
-
Using IntelliJ IDEA:
- Right-click the
test
directory or the project root. - Select
Run 'All Tests'
.
- Right-click the
-
Using Eclipse:
- Right-click the
src/test/java
directory or the project root. - Select
Run As
>JUnit Test
.
- Right-click the
You can run individual test classes, especially the assertion case classes:
-
Using IntelliJ IDEA:
- Navigate to the specific test class (e.g.,
AccountTest.java
). - Right-click the class and select
Run 'AccountTest'
.
- Navigate to the specific test class (e.g.,
-
Using Eclipse:
- Navigate to the specific test class (e.g.,
AccountTest.java
). - Right-click the class and select
Run As
>JUnit Test
.
- Navigate to the specific test class (e.g.,
AccountTest
: Tests for account operations such as deposits, withdrawals, and transfers.OptionMenuTest
: Tests for user interactions and menu options.TestSuite
: A test suite that aggregates all the test classes for comprehensive testing.
Contributions are welcome! If you have any suggestions or improvements, feel free to open an issue or submit a pull request.
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Open a pull request
This project is licensed under the MIT License. See the LICENSE file for more details.
- The source code for the ATM Machine project is available under the MIT License from ATM Machine Project.
- Special thanks to the respective owners for providing the original ATM Machine code.