public void GetxyValuesToMouseMoveCommandTest() { var command = "go to zero one two three four five six seven"; // TODO: Initialize to an appropriate value var expected = "0123,4567"; // TODO: Initialize to an appropriate value string actual; actual = CommandParametersManager.GetxyValuesToMouseMoveCommand(command); Assert.AreEqual(expected, actual); }
public void GetTabIndexForGoToTabCommandTest() { string command = "go to tab one"; // TODO: Initialize to an appropriate value string expected = "1"; // TODO: Initialize to an appropriate value string actual; actual = CommandParametersManager.GetTabIndexForGoToTabCommand(command); Assert.AreEqual(expected, actual); }
public void GetWebsiteNameForGoCommandTest() { var commandSegments = new List <string> { "go", "to", "google" }; // The command provided by the user var expected = "facebook"; // Expected value string actual; actual = CommandParametersManager.GetWebsiteNameForGoCommand(commandSegments); Assert.AreEqual(expected, actual); }
/// <summary> /// This method will return the command type with/without parameters to be executed /// </summary> /// <param name="commandTypes"></param> /// <param name="command"></param> /// <returns></returns> private static Dictionary <CommandType, object> GetCommandDetails(IReadOnlyCollection <CommandType> commandTypes, string command) { try { var resultDictionary = new Dictionary <CommandType, object>(); if (commandTypes == null) { return(null); } if (commandTypes.Count == 1) { var commandType = commandTypes.FirstOrDefault(); switch (commandType) { case CommandType.go: { resultDictionary.Add(commandType, CommandParametersManager.GetWebsiteNameForGoCommand(command.Split(' ').ToList())); break; } case CommandType.go_to_tab: { resultDictionary.Add(commandType, CommandParametersManager.GetTabIndexForGoToTabCommand(command)); break; } case CommandType.move: { resultDictionary.Add(commandType, CommandParametersManager.GetxyValuesToMouseMoveCommand(command)); break; } default: { resultDictionary.Add(commandType, ""); break; } } } return(resultDictionary); } catch (Exception ex) { Log.ErrorLog(ex); throw; } }