public void CreateReport_TeamLeadAndDirectorCreateReports_CorrectPhysicalFiles() { _director.OpenTask(_physicsTaskId); _director.ActiveTask(_physicsTaskId); _director.ResolveTask(_physicsTaskId); _director.CreateDayReport("DirectorDayReport.txt"); _teamLead.CreateSprintReport("OneTaskReportFromTeamLead.txt"); string fileData1; using (var sr = new StreamReader(@"D:\ООП\OneTaskReportFromTeamLead.txt")) { fileData1 = sr.ReadToEnd(); } string fileData; using (var sr = new StreamReader(@"D:\ООП\DirectorDayReport.txt")) { fileData = sr.ReadToEnd(); } Assert.That(fileData1, Is.EqualTo($"Make Physics task\nId: {_physicsTaskId}\nState: Resolved\nShit\n")); Assert.That(fileData, Is.EqualTo($"Make Physics task\nId: {_physicsTaskId}\nState: Resolved\nShit\n")); }
public static void Call(TeamLead teamLead) { var exit = false; var command = 0; while (!exit) { PrintEmployeeMenu(); try { command = int.Parse(ReadLine()); } catch { WriteLine("Invalid command"); } switch (command) { case 0: exit = true; break; case 1: foreach (var task in TaskData.TasksById.Values) { WriteLine(task.ToString()); } break; case 2: WriteLine("What is the name of the task?"); var name = ReadLine(); WriteLine("What is the description of the task?"); var description = ReadLine(); var id = teamLead.CreateTask(name, description); WriteLine($"New task id: {id}"); break; case 3: WriteLine("What is the id of the task?"); var taskId = ReadLine(); WriteLine("Write your comment:"); var comment = ReadLine(); teamLead.CreateCommit(taskId, comment); break; case 4: WriteLine("What is the id of the task?"); taskId = ReadLine(); teamLead.OpenTask(taskId); break; case 5: WriteLine("What is the id of the task?"); taskId = ReadLine(); teamLead.ActiveTask(taskId); break; case 6: WriteLine("What is the id of the task?"); taskId = ReadLine(); teamLead.ResolveTask(taskId); break; case 7: WriteLine("What is the name for the report?"); name = ReadLine(); teamLead.CreateDayReport(name); break; case 8: WriteLine("What is the name for the report?"); name = ReadLine(); teamLead.CreateSprintReport(name); break; case 9: teamLead.UpdateSprintReport(); break; case 10: WriteLine("What is the id of the task?"); taskId = ReadLine(); var resultSubordinate = SearchSubordinate(teamLead); teamLead.UpdateTaskEmployee(taskId, resultSubordinate); break; case 11: resultSubordinate = SearchSubordinate(teamLead); teamLead.AddNewSubordinate(resultSubordinate); break; case 12: foreach (var subordinate in teamLead.Subordinates()) { WriteLine(subordinate.ToString()); } break; case 13: teamLead.CloseCurrentSprintReport(); break; default: WriteLine("Wrong command!"); break; } } }