Skip to content

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.

License

Notifications You must be signed in to change notification settings

sancakerkan/ATM-Machine-UnitTesting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ATM Machine Unit Testing

Java JUnit Maven GitHub Issues License: MIT

Table of Contents

Introduction

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.

Features

  • 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.

UML Diagram and Project Structure

UML Diagram

Project Structure

Installation

Prerequisites

  • Java Development Kit (JDK) 8 or later
  • An IDE with Maven support (IntelliJ IDEA, Eclipse, etc.)

Cloning the Repository

  1. 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.
  2. 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.
  3. OR Simply Download the ZIP file

Usage

Running the ATM Application

  1. Using IntelliJ IDEA:

    • Open the project.
    • Navigate to src/main/java/ATM.java.
    • Right-click ATM.java and select Run 'ATM.main()'.
  2. Using Eclipse:

    • Open the project.
    • Navigate to src/main/java/ATM.java.
    • Right-click ATM.java and select Run As > Java Application.

Testing

Running All Tests

  1. Using IntelliJ IDEA:

    • Right-click the test directory or the project root.
    • Select Run 'All Tests'.
  2. Using Eclipse:

    • Right-click the src/test/java directory or the project root.
    • Select Run As > JUnit Test.

Running Individual Test Classes

You can run individual test classes, especially the assertion case classes:

  1. Using IntelliJ IDEA:

    • Navigate to the specific test class (e.g., AccountTest.java).
    • Right-click the class and select Run 'AccountTest'.
  2. Using Eclipse:

    • Navigate to the specific test class (e.g., AccountTest.java).
    • Right-click the class and select Run As > JUnit Test.

Test Structure

  • 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.

Contributing

Contributions are welcome! If you have any suggestions or improvements, feel free to open an issue or submit a pull request.

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a pull request

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Acknowledgements

  • 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.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Languages