private static void PrintEmployee(Employee employee, FormatDimensions formatDimensions) { Console.WriteLine(formatDimensions.ToFormatString(), employee.FullName, employee.Position, employee.SeparationDateToString); }
private static void PrintResult(IEnumerable<Employee> employees) { var formatDimensions = new FormatDimensions(employees); PrintHeader(formatDimensions); foreach (var employee in employees) { PrintEmployee(employee, formatDimensions); } }
private static void PrintHeader(FormatDimensions formatDimensions) { Console.WriteLine(formatDimensions.ToFormatString(), "Name", "Position", "Separation Date"); Console.WriteLine(String.Empty.PadRight(formatDimensions.TotalWidth(), '-')); }