Beispiel #1
0
        public bool Execute(char command, IRobotWars robot)
        {
            _validate = new ValidateCommand();
            if (robot == null || !_validate.IsValid(command))
                return false;
            this.ProcessCommand(command, robot);

            return true;
        }
Beispiel #2
0
        public bool Execute(char command, IRobotWars robot)
        {
            _validate = new ValidateCommand();
            if (robot == null || !_validate.IsValid(command))
            {
                return(false);
            }
            this.ProcessCommand(command, robot);

            return(true);
        }
Beispiel #3
0
        public void SuccessValidate()
        {
            var person = new Person()
            {
                Name = "Oi", Age = 10, Address = new Address()
                {
                    Name = "Oi"
                }
            };

            _validator = new ValidateWithJSONCommand(_validators.ToList());

            _validator.Execute(person);
        }
        public void SuccessValidate()
        {
            var person = new Person()
            {
                Name = "Oi", Age = 10, Address = new Address()
                {
                    Name = "Oi"
                }
            };

            _validator = new ValidateWithAttributesCommand();

            _validator.Execute(person);
        }
 private bool ExecuteInternal(char character, IRobotWars robot, IValidateCommand validation)
 {
     if(validation.IsMoveCommand(character.ToString(CultureInfo.InvariantCulture)))
     {
         ICommand command = new MoveCommand();
         command.Execute(character, robot);
     }
     else
     {
         ICommand command = new SpinCommand();
         command.Execute(character, robot);
     }
     return true;
 }
Beispiel #6
0
 private bool ExecuteInternal(char character, IRobotWars robot, IValidateCommand validation)
 {
     if (validation.IsMoveCommand(character.ToString(CultureInfo.InvariantCulture)))
     {
         ICommand command = new MoveCommand();
         command.Execute(character, robot);
     }
     else
     {
         ICommand command = new SpinCommand();
         command.Execute(character, robot);
     }
     return(true);
 }
 public PersonsController(IValidateCommand service)
 {
     _validator = service;
 }
        private ValidationException Execute(Person person)
        {
            _validator = new ValidateWithAttributesCommand();

            return(Assert.Throws <ValidationException>(() => _validator.Execute(person)));
        }
Beispiel #9
0
        private ValidationException Execute(Person person)
        {
            _validator = new ValidateWithJSONCommand(_validators.ToList());

            return(Assert.Throws <ValidationException>(() => _validator.Execute(person)));
        }
 public CreateMoveCommandLineReader(IContext context)
 {
     this._context = context;
      _validation = new ValidateCommand();
 }
Beispiel #11
0
 public CreateMoveCommandLineReader(IContext context)
 {
     this._context = context;
     _validation   = new ValidateCommand();
 }