public void TestAddAndGetUserReport() { var userReports = new List <UserReport>(); var userAJanuaryReports = SupportRepositoryJsonFileTesting .GenerateUserWeeklyReportRecords(UserA, new DateTime(2019, 1, 1)); userReports.AddRange(userAJanuaryReports); var userAFebruaryReports = SupportRepositoryJsonFileTesting .GenerateUserWeeklyReportRecords(UserA, new DateTime(2019, 2, 1)); userReports.AddRange(userAFebruaryReports); var userBJanuaryReports = SupportRepositoryJsonFileTesting .GenerateUserWeeklyReportRecords(UserB, new DateTime(2018, 1, 1)); userReports.AddRange(userBJanuaryReports); var userBFebruaryReports = SupportRepositoryJsonFileTesting .GenerateUserWeeklyReportRecords(UserB, new DateTime(2018, 2, 1)); userReports.AddRange(userBFebruaryReports); var userBMarchReports = SupportRepositoryJsonFileTesting .GenerateUserWeeklyReportRecords(UserB, new DateTime(2019, 3, 1)); userReports.AddRange(userBMarchReports); foreach (var userReport in userReports) { UserReportsRepo.Add(userReport); } var records = UserReportsRepo.GetAll(); Console.WriteLine("\n"); Console.WriteLine("Test add and get user reports"); PrintUserReportInfo(records); }
public void TestAddAndGetTimeRecords() { TimeRecordRepo.Add(SupportRepositoryJsonFileTesting.GenerateStartWorkingTimeRecord(UserA, -1)); TimeRecordRepo.Add(SupportRepositoryJsonFileTesting.GenerateStartWorkingTimeRecord(UserA, 0)); TimeRecordRepo.Add(SupportRepositoryJsonFileTesting.GenerateStartWorkingTimeRecord(UserA, 0)); TimeRecordRepo.Add(SupportRepositoryJsonFileTesting.GenerateStartWorkingTimeRecord(UserB, -2)); TimeRecordRepo.Add(SupportRepositoryJsonFileTesting.GenerateStartWorkingTimeRecord(UserB, -1)); TimeRecordRepo.Add(SupportRepositoryJsonFileTesting.GenerateStartWorkingTimeRecord(UserB, 0)); var records = TimeRecordRepo.GetAll(); Console.WriteLine("\n"); Console.WriteLine("Test add and get records"); PrintTimeRecordsInfo(records); }