Exemplo n.º 1
0
        public int AddFruit(Fruit fruit)
        {
            var random = new Random();
            var rand   = random.Next(1, 100);

            if (rand < 70 && !fruit.IsRotten)
            {
                Bowl.Fruits.Add(fruit);
                _logger.Log($"{fruit.Name} added to the bowl");
            }
            else
            {
                _logger.Log($"{fruit.Name} not added to the bowl because it was rotten");
            }
            return(Bowl.FruitAmount());
        }
Exemplo n.º 2
0
 public Juicer(float maximumWeight)
 {
     Bowl  = new Bowl(maximumWeight);
     Press = new Press();
 }