Ejemplo n.º 1
0
        public string CreateMotorcycle(string type, string model, int horsePower)
        {
            var currentMotorcycle = MotorcycleFactory.CreateMotorcycle(type, model, horsePower);

            this.motorcycleRepository.Add(currentMotorcycle);

            return(string.Format(OutputMessages.MotorcycleCreated, type, model));
        }
Ejemplo n.º 2
0
        public ChampionshipController()
        {
            this.motorcycleFactory = new MotorcycleFactory();

            this.motoRepository  = new MotorcycleRepository();
            this.riderRepository = new RiderRepository();
            this.raceRepository  = new RaceRepository();
        }
        public ChampionshipController()
        {
            motorcycleRepo = new MotorcycleRepository();
            raceRepo       = new RaceRepository();
            riderRepo      = new RiderRepository();

            motorcycleFactory = new MotorcycleFactory();
            raceFactory       = new RaceFactory();
            riderFactory      = new RiderFactory();
        }
        public ChampionshipController(
            IRepository <IMotorcycle> motorcycleRepository,
            IRepository <IRace> raceRepository,
            IRepository <IRider> riderRepository,
            MotorcycleFactory motorcycleFactory)
        {
            this.motorcycleRepository = motorcycleRepository;
            this.raceRepository       = raceRepository;
            this.riderRepository      = riderRepository;

            this.motorcycleFactory = motorcycleFactory;
        }