public void WriteRecordShouldTwoReportsIfTFCodeOptionalIsSet()
        {
            var repoMock        = new ReportRepositoryMock();
            var writerMock      = new FileWriterMock();
            var reportGenerator = new ReportGenerator(repoMock, writerMock, new Logger(), new CustomSettings());

            var preRepoMockCount = repoMock.AsQueryable().Count();

            Assert.AreEqual(0, writerMock.RecordList.Count, "The writer should have an empty list before the generator is called");
            reportGenerator.WriteRecordsToFileAndAlterReportStatus();

            Assert.AreEqual(repoMock.Report9Accepted.TFCodeOptional, writerMock.RecordList.ElementAt(2).TFCode, "The TFCodeOptional from Report9 should be the same as TFCode on record 3");
            Assert.AreEqual(new DateTime(2015, 3, 31).Date, writerMock.RecordList.ElementAt(2).Date.Date, "The date of the first record should be March 31 2015");
            Assert.AreEqual(1400, writerMock.RecordList.ElementAt(2).ReimbursementDistance, "The distance of the third record should be 1400");

            Assert.AreEqual(repoMock.Report9Accepted.TFCode, writerMock.RecordList.ElementAt(4).TFCode, "The TFCode from Report9 should be the same as TFCode on record 5");
            Assert.AreEqual(new DateTime(2015, 3, 31).Date, writerMock.RecordList.ElementAt(4).Date.Date, "The date of the fifth record should be March 31 2015");
            Assert.AreEqual(600, writerMock.RecordList.ElementAt(4).ReimbursementDistance, "The distance of the fifth record should be 600");

            Assert.AreEqual(preRepoMockCount, repoMock.AsQueryable().Count(), "Reports created with Optional TFCode should not be saved");
        }
        public void TestReceiveReportsToInvoiceSD()
        {
            var repoMock        = new ReportRepositoryMock();
            var writerMock      = new FileWriterMock();
            var reportGenerator = new ReportGenerator(repoMock, writerMock, new Logger(), new CustomSettings());

            var acceptedReports  = repoMock.AsQueryable().Where(x => x.Status == ReportStatus.Accepted && x.Distance > 0).ToList();
            var preRepoMockCount = acceptedReports.Count();

            var reportToInvoice = reportGenerator.ReceiveReportsToInvoiceSD();

            Assert.AreNotEqual(preRepoMockCount, reportToInvoice.Count, "The number of reports before receiving reports to invoice should contain less reports");
            Assert.AreEqual(8, reportToInvoice.Count, "The number of reports to invoice should be 7");

            var reportsWithTFCode          = acceptedReports.Where(x => x.TFCode == "310-4").ToList();
            var reportsToInvoiceWithTFCode = reportToInvoice.Where(x => x.TFCode == "310-4").ToList();

            Assert.AreEqual(5, reportsWithTFCode.Count, "The number of accepted reports before, should be 5");
            Assert.AreEqual(6, reportsToInvoiceWithTFCode.Count, "The number of accepted reports after, should be 6");
        }