This is a vending machine emulator built using .NET Core. It simulates inserting coins, selecting a product, and getting the corresponding change. Validations such as product availability, change availability, and validating the inserted amount of money are also implemented in this solution. When a user buys a product, the machine stores the coins on a stack and uses them later for providing change.
To get a local copy up and running follow these simple example steps.
- Visual Studio 2022 or later
- Clone the repository on your machine
- Open the file
VendingMachine.slnusing Visual Studio 2022 - Build the solution using
CTRL+Shift+Bto check for errors (and also restore Nuget packages) - Run the unit tests using
CTRL+R, A - Right-click on the project
VendingMachine.Weband set it as the startup project - Hit
F5and you should get the project up and running
- Create an algorithm for selecting the change
- Code MachineCoinStack and UserCoinStack classes
- Code Product and ProductGrid classes
- Create a ChangeService
- Create MachineService
- Unit tests
- Web interface for basic operation of the machine
- Show the amount of products available to the user
- Disable buttons for buying out of stock products
- Optimize application for smaller screens (responsiveness)
- Add Docker support
- Add Github Actions support
- Publish the application in a cloud service for having a live preview
See the open issues for a full list of proposed features (and known issues).
Distributed under the MIT License. See LICENSE for more information.
Jonas Amorim - @jonas1307 - jonasamorim [dot] dev [at] gmail [dot] com
Project Link: https://github.com/jonas1307/vending-machine
