public void EspressoUnitShouldReturnTrueWhenValidInputAndCleanMachine(int coffeeGrams, int waterMl)
        {
            var espressoUnit = new EspressoUnit(new CoffeeMachineEntity());
            UnitResult <CoffeeMachineEntity> result = espressoUnit.Execute(coffeeGrams, waterMl);

            Assert.IsTrue(result.IsSuccessful);
        }
        public void EspressoUnitShouldReturnFalseWhenInvalidInput(int coffeeGrams, int waterMl)
        {
            var espressoUnit = new EspressoUnit(new CoffeeMachineEntity());
            var result       = espressoUnit.Execute(coffeeGrams, waterMl);

            Assert.IsFalse(result.IsSuccessful);
        }
Ejemplo n.º 3
0
        public bool Execute()
        {
            var entity = new CoffeeMachineEntity();

            ISteamBlastUnit cleaningUnit = new SteamBlastUnit(entity);
            UnitResult <CoffeeMachineEntity> operationResult = cleaningUnit.Execute(9, 50);

            IEspressoUnit espressoUnit = new EspressoUnit(operationResult.Value);

            operationResult = espressoUnit.Execute(6, 50);

            bool isSuccessful = operationResult.IsSuccessful && operationResult.IsSuccessful;

            return(isSuccessful);
        }