public void GenerateDesktopCommandText(DesktopCommand desktopCommand, params string[] parameters) { var generatedCommandParameters = string.Empty; var command = _keyBindsStrings[desktopCommand]; _lastCommand = command; foreach (var p in parameters) { if (!string.IsNullOrWhiteSpace(p)) { generatedCommandParameters = $"{generatedCommandParameters} {p.Trim()}"; generatedCommandParameters = generatedCommandParameters.Trim(); } } if (!string.IsNullOrWhiteSpace(generatedCommandParameters)) { if (!string.IsNullOrEmpty(GeneratedCommandText)) { GeneratedCommandText += $"$${command} {generatedCommandParameters}"; } else { GeneratedCommandText = $"{command} {generatedCommandParameters}"; } } else { if (!string.IsNullOrEmpty(GeneratedCommandText)) { GeneratedCommandText += $"$${command}"; } else { GeneratedCommandText = command; } } }
public ManagedCharacter GetCharacterUnderTestWithCommandGenerationSetupToCommand(DesktopCommand command, string[] parameters) { var character = CharacterUnderTest; character.IsSpawned = true; var generator = GetMockKeyBindCommandGeneratorForCommand(command, parameters); character.Generator = generator; return(character); }