示例#1
0
        public string Chip(string robotName, int procedureTime)
        {
            IRobot robot = CheckRobot(robotName);

            ChipProcedure.DoService(robot, procedureTime);
            return(string.Format(OutputMessages.ChipProcedure, robotName));
        }
示例#2
0
        public string Chip(string name, int procedureTime)
        {
            var animal = GetAnimal(name);

            chip.DoService(animal, procedureTime);
            return($"{animal.Name} had chip procedure");
        }
示例#3
0
        public string Chip(string name, int procedureTime)
        {
            IChip chip = new Chip();

            chip.DoService(hotel.GetAnimalData(name), procedureTime);
            return($"{name} had chip procedure");
        }
示例#4
0
        public string Chip(string name, int procedureTime)
        {
            CheckIfAnimalExist(name);

            chip.DoService(hotel.Animals[name], procedureTime);

            return($"{name} had chip procedure");
        }
示例#5
0
        public string Chip(string name, int procedureTime)
        {
            DoesAnimalExistInHotel(name);
            var animal = this.hotel.Animals[name];

            chip.DoService(animal, procedureTime);

            return($"{name} had chip procedure");
        }
        public string Chip(string robotName, int procedureTime)
        {
            isRobotExist(robotName);
            Procedure procedure    = new Chip();
            var       currentRobot = garage.Robots[robotName];

            procedure.DoService(currentRobot, procedureTime);
            return($"{currentRobot.Name} had chip procedure");
        }
示例#7
0
        public string Chip(string robotName, int procedureTime)
        {
            RobotExist(robotName); //throws exception if doesn't exist

            chip = new Chip();
            chip.DoService(GetRobotByName(robotName), procedureTime);

            return($"{robotName} had chip procedure");
        }
        public string Chip(string name, int procedureTime)
        {
            IAnimal animal = CheckForAnimal(name);

            chip.DoService(animal, procedureTime);
            string result =
                $"{name} had chip procedure";

            return(result);
        }
示例#9
0
        public string Chip(string robotName, int procedureTime)
        {
            IRobot    robot     = GetRobotToDoProcedure(robotName);
            Procedure procedure = new Chip();

            procedure.DoService(robot, procedureTime);
            AddProcedureToRobot(robotName, procedureTime, procedure);

            return(String.Format(OutputMessages.ChipProcedure, robot.Name));
        }
示例#10
0
        public string Chip(string robotName, int procedureTime)
        {
            var        currentRobot = RobotExistsInGarage(robotName);
            IProcedure chip         = new Chip();

            chip.DoService(currentRobot, procedureTime);
            AddProcedure(chip, currentRobot);

            return(String.Format(OutputMessages.ChipProcedure, currentRobot.Name));
        }
示例#11
0
        public string Chip(string robotName, int procedureTime)
        {
            DoesRobotExists(robotName);

            var  robot = garage.Robots.FirstOrDefault(r => r.Value.Name == robotName);
            Chip chip  = new Chip();

            chip.DoService(robot.Value, procedureTime);

            return($"{robotName} had chip procedure");
        }
示例#12
0
        public string Chip(string name, int procedureTime)
        {
            if (hotel.Animals.ContainsKey(name) == false)
            {
                throw new ArgumentException($"Animal {name} does not exist");
            }
            IAnimal currentAnimal = hotel.Animals.FirstOrDefault(x => x.Key == name).Value;

            chip.DoService(currentAnimal, procedureTime);
            return($"{currentAnimal.Name} had chip procedure");
        }
示例#13
0
        public string Chip(string name, int procedureTime)
        {
            var animal = this.hotel
                         .Animals
                         .Values
                         .First(x => x.Name == name);

            chip.DoService(animal, procedureTime);

            return($"{name} had chip procedure");
        }
示例#14
0
        public string Chip(string name, int procedureTime)
        {
            var animal = GetAnimal(name);


            chipped.DoService(animal, procedureTime);
            string result = $"{name} had chip procedure";

            this.chipped.ProcedureHistory.Add(animal);
            return(result);
        }
示例#15
0
        public string Chip(string name, int procedureTime)
        {
            if (!AnimalExists(name))
            {
                throw new ArgumentException($"Animal {name} does not exist");
            }
            IAnimal currentAnimal = hotel.Animals[name];

            chip.DoService(currentAnimal, procedureTime);
            return($"{name} had chip procedure");
        }
示例#16
0
        public string Chip(string name, int procedureTime)
        {
            CheckIfAnimalExists(name);

            IAnimal animal = GetAnimal(name);

            chip.DoService(animal, procedureTime);
            chip.ProcedureHistory.Add(animal);

            return($"{animal.Name} had chip procedure");
        }
        public string Chip(string name, int procedureTime)
        {
            if (!hotel.Animals.ContainsKey(name))
            {
                throw new ArgumentException($"Animal {name} does not exist");
            }
            var animal = hotel.Animals[name];

            chip.DoService(animal, procedureTime);

            return($"{name} had chip procedure");
        }
        public string Chip(string robotName, int procedureTime)
        {
            if (!garage.Robots.ContainsKey(robotName))
            {
                throw new ArgumentException(string.Format(ExceptionMessages.InexistingRobot, robotName));
            }

            chip.DoService(garage.Robots[robotName], procedureTime);
            chip.Robots.Add(garage.Robots[robotName]);

            return($"{string.Format(OutputMessages.ChipProcedure, robotName)}");
        }
示例#19
0
        public string Chip(string name, int procedureTime)
        {
            Chip chip = new Chip();

            var animal = this.hotel.Animals[name];

            chip.DoService(animal, procedureTime);

            this.proceduresAndItsAnimals["Chip"].Add(animal);

            return($"{name} had chip procedure");
        }
示例#20
0
        public string Chip(string robotName, int procedureTime)
        {
            if (this.CheckRobotExist(robotName))
            {
                return($"Robot {robotName} does not exist");
            }

            var robot = this.garage.Robots[robotName];

            chip.DoService(robot, procedureTime);

            return($"{robot.Name} had chip procedure");
        }
示例#21
0
        public string Chip(string name, int procedureTime)
        {
            if (!AnimalExists(name))
            {
                throw new ArgumentException(string.Format(animalDoesntExistErrorMessage, name));
            }

            var animal = this.hotel.Animals.FirstOrDefault(a => a.Key == name).Value;

            chip.DoService(animal, procedureTime);

            return(string.Format(chipMessage, name));
        }
示例#22
0
        public string Chip(string name, int procedureTime)
        {
            string chiped = "Chip";

            CheckAnimalExist(name);
            Chip    chip   = new Chip();
            IAnimal animal = GetAnimal(name);

            chip.DoService(animal, procedureTime);
            AddHistory(animal, chiped);

            return($"{name} had chip procedure");
        }
        public string Chip(string name, int procedureTime)
        {
            IAnimal animal = GetAnimal(name, procedureTime);
            Chip    chip   = new Chip();

            chip.DoService(animal, procedureTime);

            AddToHistory(chip.GetType().Name, animal);

            string result = $"{animal.Name} had chip procedure";

            return(result);
        }
示例#24
0
        public string Rest(string robotName, int procedureTime)
        {
            if (!garage.Robots.ContainsKey(robotName))
            {
                throw new ArgumentException($"Robot {robotName} does not exist");
            }
            IRobot     currentRobot = garage.Robots.GetValueOrDefault(robotName);
            IProcedure rest         = new Chip();

            rest.DoService(currentRobot, procedureTime);
            string result = $"{currentRobot.Name} had rest procedure";

            return(result);
        }
示例#25
0
        public string Chip(string name, int procedureTime)
        {
            CheckForAnimal(name);
            Chip   chip   = new Chip();
            Animal animal = hotel.Animals.Values.FirstOrDefault(x => x.Name == name);

            chip.DoService(animal, procedureTime);
            if (!history.ContainsKey("Chip"))
            {
                history.Add("Chip", new List <Animal>());
            }
            history["Chip"].Add(animal);
            return($"{name} had chip procedure");
        }
示例#26
0
        public string Chip(string name, int procedureTime)
        {
            if (hotel.Animals.ContainsKey(name) == false)
            {
                throw new ArgumentException($"Animal {name} does not exist");
            }

            var animal = hotel.Animals[name];

            chip.DoService(animal, procedureTime);
            chip.ProcedureHistory.Add(animal);
            this.procedures.Add(chip);

            return($"{name} had chip procedure");
        }
示例#27
0
        public string Chip(string name, int procedureTime)
        {
            if (IsExistInHotel(name))
            {
                throw new ArgumentException($"Animal {name} does not exist");
            }

            Procedure procedure = new Chip();

            procedure.DoService(animalsInHotel[name], procedureTime);
            procedures.Add(procedure);
            string result = $"{name} had chip procedure";

            return(result);
        }
示例#28
0
        public string Chip(string name, int procedureTime)
        {
            AnimalDoesntExist(name);

            IAnimal animal = TakeAnimal(name);

            IProcedure chip = new Chip();

            chip.DoService(animal, procedureTime);

            AddTypeProcedure(chip);

            return(string.Format(
                       ConstantMessages.HadProcedure,
                       animal.Name,
                       "chip"));
        }
示例#29
0
        public string Chip(string name, int procedureTime)
        {
            this.DoesExist(name);

            var animal = hotel.GetAnimal(name);

            if (this.procedures.Any(p => p.GetType().Name == "Chip"))
            {
                this.procedures.First(p => p.GetType().Name == "Chip")
                .DoService(animal, procedureTime);
            }
            else
            {
                Procedure procedure = new Chip();
                procedure.DoService(animal, procedureTime);
                this.procedures.Add(procedure);
            }

            return($"{name} had chip procedure");
        }
示例#30
0
        public string Chip(string name, int procedureTime)
        {
            if (!this.hotel.Animals.ContainsKey(name))
            {
                throw new ArgumentException($"Animal {name} does not exist");
            }

            var animal = this.hotel.Animals.First(x => x.Value.Name == name).Value;

            if (this.procedures.Any(x => x.GetType() == typeof(Chip)))
            {
                this.procedures.First(x => x.GetType() == typeof(Chip)).DoService(animal, procedureTime);
            }

            else
            {
                var chip = new Chip();
                chip.DoService(animal, procedureTime);
                this.procedures.Add(chip);
            }

            return($"{animal.Name} had chip procedure");
        }