Skip to content

Instantly share code, notes, and snippets.

@AviiNL
Created January 7, 2019 15:46
Show Gist options
  • Save AviiNL/6be580ea783cd6a9d90228a6e82b551d to your computer and use it in GitHub Desktop.
Save AviiNL/6be580ea783cd6a9d90228a6e82b551d to your computer and use it in GitHub Desktop.
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