public void ExecuteActionTest(Action action, int expectedResult)
        {
            var robotActions = new RobotActions(_robot, _actionStrength);

            robotActions.SetAction(action);
            var result = robotActions.GetResult();

            Assert.AreEqual(expectedResult, result);
        }
Beispiel #2
0
 /// <summary>
 /// Translates the action to a suitable command.
 /// </summary>
 /// <param name="action">The action to translate.</param>
 /// <returns>The string representation of the action.</returns>
 public static string TranslateAction(RobotActions action)
 {
     if (_actionTranslations.ContainsKey(action))
     {
         return(_actionTranslations[action]);
     }
     else
     {
         throw new ArgumentException("Unknown action: " + action.ToString());
     }
 }
        private static Dictionary <ActionCommand, int> ActionCommands()
        {
            Setup();

            var robotActions = new RobotActions(_robot, _actionStrength);

            return(new Dictionary <ActionCommand, int>
            {
                { new AttackAction(robotActions), 24 },
                { new DefenceAction(robotActions), 0 },
                { new RestAction(robotActions), 14 }
            });
        }