public void StartRide(Scooter scooter)
        {
            if (scooter.IsRented || _activeRides.ContainsKey(scooter.Id))
            {
                throw new ScooterRentalInProgressException($"Scooter \"{scooter.Id}\" already rented.");
            }

            _activeRides.Add(scooter.Id, new Ride(scooter, DateTime.Now));
            scooter.IsRented = true;
        }
Beispiel #2
0
 public Ride(Scooter scooter, DateTime startTime)
 {
     Scooter   = scooter;
     StartTime = startTime;
 }