|
I downloaded the test solution source, as I was wanting to test EntitySpaces for myself and I didn't know if they were going to participate or not.
After running the tests, I noticed there didn't seem to be a good method of getting the test results loaded into a spreadsheet. Thus, I added code to the Scorecard.cs class which will output a tab delimited string of the results. I then called this method from the PerformanceTestRunner and output it to a file. I thought you might be interested in the following code:
public string ToDelimitedString()
{
string delimiter = "\t";
StringBuilder sb = new StringBuilder();
AppendDelimitedField(sb, string.Empty, delimiter);
foreach (var tool in Tools)
AppendDelimitedField(sb, tool, delimiter);
sb.AppendLine();
foreach (var test in Tests)
{
AppendDelimitedField(sb, GetPrintableTestName(Indent(test)), delimiter);
if (!(test.IsNullOrEmpty() || test.EndsWith(":")))
foreach (var tool in Tools)
{
object result = Get(tool, test);
string r = string.Format("{0,10}", result ?? "n/a");
AppendDelimitedField(sb, r, delimiter);
}
sb.AppendLine();
}
return sb.ToString();
}
private void AppendDelimitedField(StringBuilder sb, string field, string delimiter)
{
sb.Append(field);
sb.Append(delimiter);
}
|