コード例 #1
0
        public Controller()
        {
            this.astronautRepository = new AstronautRepository();
            this.astronautFactory    = new AstronautFactory();

            this.planetRepository = new PlanetRepository();
            this.planetsExplored  = new List <IPlanet>();
        }
コード例 #2
0
        public string AddAstronaut(string type, string astronautName)
        {
            if (!AstronautValidatorType.ValidateAstronautType(type))
            {
                throw new InvalidOperationException(ExceptionMessages.InvalidAstronautType);
            }

            var newAstronaut = AstronautFactory.CreateAstronaut(type, astronautName);

            astrRepo.Add(newAstronaut);

            return(string.Format(OutputMessages.AstronautAdded, type, astronautName));
        }
コード例 #3
0
 public Controller()
 {
     this.astronautRepository = new AstronautRepository();
     this.planetRepository    = new PlanetRepository();
     this.astronautFactory    = new AstronautFactory();
 }