public void Execute(List <string> argument) { var listArgs = GetClientSpecification(argument); var formatter = factory.GetFormatter(listArgs); var tasks = client.GetTasks(listArgs); PrintWithFormatter(tasks, formatter); }
public void should_print_info_on_required_tasks() { var argument = new List <string> { "153" }; var listPackage = new List <ClientTask> { new ClientTask { DueDate = DateTime.Now, Id = 1, IsCompleted = true } }; var formatter = Substitute.For <ITaskFormatter>(); converter.Convert(argument, Arg.Is <List <Type> >(listTypes => types.SequenceEqual(types))).Returns(args); factory.GetFormatter(args).Returns(formatter); formatter.ToFormatString(listPackage).Returns("hello world"); client.GetTasks(args).Returns(listPackage); command.Execute(argument); sb.ToString().Should().BeEquivalentTo("hello world\r\n"); }