/// <summary> /// Adds the body of the main method to the visualizer class. /// </summary> private void AddVisualizerMainMethodBody( JavaFileBuilder builder, MethodQuestionTest methodTest, CodeQuestionSubmission submission) { string variableDeclaration = Question.ReturnType == "void" ? "" : $"{Question.ReturnType} returnValue = "; builder.AddLine($"{variableDeclaration}{Question.MethodName}({methodTest.ParameterValues});"); }
/// <summary> /// Returns the description of a code test. /// </summary> protected override string GetTestDescription(CodeQuestionTest test) { MethodQuestionTest methodQuestionTest = test as MethodQuestionTest; if (methodQuestionTest == null) { throw new ArgumentException("Invalid test type", nameof(test)); } return($"{Question.MethodName}({methodQuestionTest.ParameterValues})"); }