Hiptest.Publisher.Samples.Actionwords.ITakeCoffeeNumberCoffees C# (CSharp) Method

ITakeCoffeeNumberCoffees() public method

public ITakeCoffeeNumberCoffees ( int coffeeNumber ) : void
coffeeNumber int
return void
        public void ITakeCoffeeNumberCoffees(int coffeeNumber)
        {
            while ((coffeeNumber > 0)) {
                ITakeACoffee();
                coffeeNumber = coffeeNumber - 1;

                if (Handled.Contains("Water")) {
                    IFillTheWaterTank();
                }

                if (Handled.Contains("Beans")) {
                    IFillTheBeansTank();
                }

                if (Handled.Contains("Grounds")) {
                    IEmptyTheCoffeeGrounds();
                }
            }
        }

Usage Example

Ejemplo n.º 1
0
 public void FullGroundsDoesNotBlockCoffee()
 {
     // Given the coffee machine is started
     Actionwords.TheCoffeeMachineIsStarted();
     // And I handle everything except the grounds
     Actionwords.IHandleEverythingExceptTheGrounds();
     // When I take "50" coffees
     Actionwords.ITakeCoffeeNumberCoffees(50);
     // Then message "Empty grounds" should be displayed
     Actionwords.MessageMessageShouldBeDisplayed("Empty grounds");
     // And coffee should be served
     Actionwords.CoffeeShouldBeServed();
 }
All Usage Examples Of Hiptest.Publisher.Samples.Actionwords::ITakeCoffeeNumberCoffees