private void AssertParameters(params string[] args)
{
var commandMock = NewCommand<SearchCommand>(mock => mock.Setup(proxy => proxy.SearchIssues(args[0])).Returns(Issues));
Mock<IContext> contextMock = ContextMockFor("some-user", args);
string status = (args.Length == 2) ? args[1] : "open";
int max = 0;
string expected = Issues.Where(FilterByStatus(status)).Aggregate("", (buffer, issue) =>
{
string formatedIssue = issue.Format();
max = Math.Max(max, formatedIssue.Length);
return buffer + "\r\n" + formatedIssue;
});
expected = string.Format("Issue Status Created Sumary{0}{1}{2}{0}", Environment.NewLine, new String('-', max), expected);
Assert.AreEqual(expected, commandMock.Process(contextMock.Object).HumanReadable);
commandMock.Verify();
}