public void TestInvoiceSender()
        {
            var clientTo = new DefaultClientsWrappers().Data.First();
            var emailConfig = new DefaultEmailWrapper().Data;
            var ic = new DefaultInvoiceWrapper().Data;
            var icd = new WeeklyInvoiceDetails
                {
                    ChargeableHours = 37.5,
                    Number = 21,
                    HourlyRate = 44,
                    CommentsOrSpecialInstructions = "This is a test invoice - there is no need to take action.",
                };

            var client = new TestClientsWrappers();

            var generator = new Generator();
            var filename = generator.CreateWeeklyInvoice(new TestInvoiceWrapper().Data, icd, client.Data.First(), new DefaultCompanyInformationWrapper().Data, DateTime.Now, "C:\\Hardcore Software\\iSec\\Invoices\\");
            Assert.DoesNotThrow(() => InvoiceEmailer.SendEmailWithAttachement(clientTo, emailConfig, icd, filename, DateTime.Now));
        }
        public void ReadDefaultInvoiceConfig()
        {
            var x = new DefaultInvoiceWrapper();
            Assert.IsFalse(x.IsLoaded);
            x.Load();
            Assert.IsTrue(x.IsLoaded);
            Assert.IsTrue(x.Exists());

            Assert.IsNotNullOrEmpty(x.Data.FooterText);

            Assert.IsNotNull(x.Data.AccountDetails);
            Assert.IsNotNullOrEmpty(x.Data.AccountDetails.Name);
            Assert.IsNotNullOrEmpty(x.Data.AccountDetails.Number);
            Assert.IsNotNullOrEmpty(x.Data.AccountDetails.SortCode);

            Assert.IsNotNull(x.Data.ChargeableJob);
            Assert.IsNotNullOrEmpty(x.Data.ChargeableJob.Quantity.ToString(CultureInfo.InvariantCulture));
            Assert.IsNotNullOrEmpty(x.Data.ChargeableJob.Description);
            Assert.IsNotNullOrEmpty(x.Data.ChargeableJob.UnitPrice.ToString(CultureInfo.InvariantCulture));
        }
 public void WriteDefaultInvoiceConfig()
 {
     var x = new DefaultInvoiceWrapper();
     x.Save();
     Assert.IsTrue(File.Exists(x.FullFileName));
 }