Ejemplo n.º 1
0
        public void IsTheMachineReadyToWash()
        {
            if (!TurnOn)
            {
                throw new Exception("Please, Before starting to wash turn on the washing-machine");
            }

            if (Clothes == null)
            {
                throw new Exception("You have not selected the type of clothing");
            }

            if (MachineWaterLevel < MinWaterLevel)
            {
                throw new Exception("Please, Before starting to wash, make sure you the level water is on its minimum (70%)");
            }

            if (WashingTimeEnterByUser.Minute < Clothes.getWashingTimeForInitialTypeOfClothingDateTime().Minute)
            {
                throw new Exception("Please, Before starting to wash, make sure you enter the minimum time");
            }

            if (Clothes.InitialTypeOfClothing != TypeOfClothing.Clean && !Detergent)
            {
                throw new Exception("You have not loaded detergent");
            }
        }
Ejemplo n.º 2
0
        private int GetTimeFromTheNewChangeOfClothesType(int minuteElpased)
        {
            DateTime InitialTime = Clothes.getWashingTimeForInitialTypeOfClothingDateTime();

            return((Clothes.InitialTypeOfClothing == Clothes.TypeOfClothingInWashingTime) ? minuteElpased : (InitialTime.Minute - minuteElpased));
        }