Skip to content

Fortune-Ndlovu/java-vending-machine-junit-tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

java-vending-machine-junit-tests

Welcome to the Java Vending Machine project! This is a simple command-line application that simulates a vending machine where users can insert coins, select products, and receive their chosen item if they have enough balance.

Table of Contents

Introduction

The Java Vending Machine is a basic application written in Java. It provides a textual interface for users to interact with the vending machine, make selections, and receive products if they have enough balance. The application uses simple command-line input and output for user interactions.

Usage

To use the Java Vending Machine, follow these steps:

  1. Clone the repository to your local machine.
  2. Open the project in your Java development environment (e.g., Visual Studio Code).
  3. Compile the VendingMachine.java file.
  4. Run the compiled Java program to start the vending machine.
  5. Follow the on-screen instructions to interact with the vending machine.
  6. Enjoy your selected products!

Features

The Java Vending Machine offers the following features:

  • Inserting coins into the machine.
  • Displaying available products and their prices.
  • Selecting a product for purchase.
  • Checking the balance after inserting coins.
  • Handling insufficient funds and displaying appropriate messages.

Setup

Before running the Java Vending Machine, make sure you have the following prerequisites installed on your system:

  1. Java Development Kit (JDK): Download JDK or OpenJDK.
  2. Integrated Development Environment (IDE) like Visual Studio Code: Download VSCode.

Testing

The Java Vending Machine project includes a set of JUnit tests to ensure the correctness of its functionality. These tests are located in the VendingMachineTest.java file.

To run the tests, follow these steps:

  1. Open the project in your Java development environment (e.g., Visual Studio Code).
  2. Navigate to the VendingMachineTest.java file.
  3. Right-click on the file and select "Run Test" to execute all test cases.
  4. The test results will be displayed in the test runner.

Contributing

Contributions to the Java Vending Machine project are welcome! If you find any issues or have ideas to improve the application, feel free to open an issue or create a pull request.

When contributing, please follow the existing code style and conventions.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages