Ejemplo n.º 1
0
        public async Task <ActionResult <RobotViewModel> > Get(int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var robot = await _robotService.GetRobot(id);

            if (robot == null)
            {
                return(NotFound());
            }
            return(Ok(new RobotViewModel(await _robotService.GetRobot(id))));
        }
Ejemplo n.º 2
0
        public void CanPersistAndRetrieveRobotFromCache()
        {
            var robot = _robotService.CreateRobot();

            _robotService.PersistRobot(robot);

            var savedRobot = _robotService.GetRobot(robot.RobotId.ToString());

            Assert.IsNotNull(savedRobot);
        }
Ejemplo n.º 3
0
        public IActionResult Index(long id)
        {
            RobotVO robot = _robotService.GetRobot(id);

            if (robot == null)
            {
                return(RedirectToAction("Index", "Home"));
            }

            RobotModel robotModel = _mapper.Map <RobotModel>(robot);

            return(View(robotModel));
        }
Ejemplo n.º 4
0
        private static Robot Robot(IRobotService robotService, Plateau plateau)
        {
            var robot = robotService.GetRobot(plateau);

            return(robot);
        }