Created
January 7, 2019 15:46
-
-
Save AviiNL/6be580ea783cd6a9d90228a6e82b551d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var coffeeMachine = new CoffeeMachine(); | |
var beans = new Beans(); | |
var cup = new Cup(); | |
var tap = new Tap(); | |
if(cup.Empty()) { | |
var ground = coffeeMachine.Grind(beans); | |
if(!ground) | |
throw new Exception("Grinding beans did not result in successful ground"); | |
coffeeMachine.AddCup(cup); | |
coffeeMachine.AddToFilter(ground); | |
coffeeMachine.Connect(tap); | |
tap.Open(); | |
WaitUntil(coffeeMachine.IsReservoirFull); | |
tap.Close(); | |
coffeeMachine.RunWaterThroughFilter(); | |
WaitUntil(cup.Full()); | |
coffeeMachine.Off(); | |
coffeeMachine.RemoveCup(cup); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment