private void ShowRegisteredComponents <T>(string heading, ICollection <T> handles, GallioFunc <T, string> getName, GallioFunc <T, string> getDescription) { Console.WriteLine(heading); Console.WriteLine(); T[] sortedHandles = GenericCollectionUtils.ToArray(handles); Array.Sort(sortedHandles, (x, y) => getName(x).CompareTo(getName(y))); if (sortedHandles.Length == 0) { CommandLineOutput.PrintArgumentHelp("", "<none>", null, null, null, null); } else { foreach (T handle in sortedHandles) { CommandLineOutput.PrintArgumentHelp("", getName(handle), null, getDescription(handle), null, null); Console.WriteLine(); } } }
public void PringArgumentHelpTest(string longName, string shortName, string description, string valueType, string expectedOutput) { _output.PrintArgumentHelp("/", longName, shortName, description, valueType, typeof(string)); Assert.AreEqual(expectedOutput, _sbOutput.ToString()); }