/// <summary> /// Returns a string containing the command line arguments separated by commas, /// with each argument quoted. /// </summary> private string[] GetCommandLineArgs(ProgramQuestionTest test, bool includeQuotes) { return(test.GetArguments().Select ( arg => arg.StartsWith("\"") ? includeQuotes ? arg : arg.Substring(1, arg.Length - 1) : includeQuotes ? $"\"{arg}\"" : arg ).ToArray()); }
/// <summary> /// Returns the command line arguments for the given test. /// </summary> protected override string[] GetVisualizerCommandLineArguments(CodeQuestionTest test) { ProgramQuestionTest programQuestionTest = test as ProgramQuestionTest; if (programQuestionTest == null) { throw new ArgumentException("Invalid test type", nameof(test)); } return(GetCommandLineArgs(programQuestionTest, includeQuotes: false)); }
/// <summary> /// Returns the description of a code test. /// </summary> protected override string GetTestDescription(CodeQuestionTest test) { ProgramQuestionTest programQuestionTest = test as ProgramQuestionTest; if (programQuestionTest == null) { throw new ArgumentException("Invalid test type", nameof(test)); } return(programQuestionTest.TestDescription); }