GithubHelp home page GithubHelp logo

vendingmachinekata's Introduction

Virtual implementation of a vending machine

The vending machine has the following features:

  1. Insert Money
  2. Select Product
  3. Coin Return
  4. Make Change

Building and Testing

To build and test from the command line, these instructions assume that the user has Visual Studio 2017 installed on the build and test machine(s).

To build the solution, run msbuild.exe on the vending.sln file.

For Example

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe" [repos location]\VendingMachineKata\Vending\Vending.sln

To run unit tests, run vstest.console.exe on the Vending.Tests.Unit dll file.

For Example:

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" [repos directory]\VendingMachineKata\Vending\Vending.Tests.Unit\bin\Debug\Vending.Tests.Unit.dll

Core Concepts

Context: Holds the current state of Machine Machine: Mutates context according to the rules set forth in Vending.dll Result: A composite End state of a method on Machine Inventory: A collection of assets to be tracked in the Context

In Vending.Tests.Unit you will find multiple implementations of IContext to show how to setup the machine.

Example code

IContext context = new DefaultContext();
var machine = new Machine();
var metal = metal.Quarter;
var result = new Result();

machine.Insert(invalidMetal, context, (r) =>
{
    result.Push(r);
}).Wait();

vendingmachinekata's People

Contributors

davidehnis avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.