Ejemplo n.º 1
0
        public void StartRent(string scooterId)
        {
            var scooter = ScooterService.GetScooterById(scooterId);

            if (scooter.IsRented)
            {
                throw new ScooterIsRented("The scooter is being rented.");
            }

            scooter.IsRented = true;
            RentHistory.Add(new RentedUnit(_transId++, scooterId, DateTime.Now, scooter.PricePerMinute));
        }