public ScheduledService(ScheduledServiceId id, BusId busId, BusRouteId routeId) { Id = id ?? throw new ArgumentNullException("id"); BusId = busId ?? throw new ArgumentNullException("busId"); RouteId = routeId ?? throw new ArgumentNullException("routeId"); IsActive = false; }
public Bus(BusId id, string number, int seating, int standing) { if (string.IsNullOrEmpty(number)) { throw new ArgumentOutOfRangeException("number", "bus number must be supplied"); } if (seating <= 0) { throw new ArgumentOutOfRangeException("seating"); } if (standing < 0) { throw new ArgumentOutOfRangeException("standing"); } Id = id ?? throw new ArgumentNullException("id"); BusNumber = number; SeatedCapacity = seating; StandingCapacity = standing; }