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 ReadDefaultClientConfig()
        {
            var x = new DefaultClientsWrappers();
            Assert.IsFalse(x.IsLoaded);
            x.Load();
            Assert.IsTrue(x.IsLoaded);
            Assert.IsTrue(x.Exists());
            Assert.IsNotNull(x.Data);

            foreach (var clientConfig in x.Data)
            {
                Assert.IsNotNullOrEmpty(clientConfig.PointOfContactEmail);
                Assert.IsNotNullOrEmpty(clientConfig.PointOfContactName);
                Assert.IsNotNull(clientConfig.CompanyInformationEntity);
                Assert.IsNotNullOrEmpty(clientConfig.CompanyInformationEntity.Name);
                Assert.IsNotNullOrEmpty(clientConfig.CompanyInformationEntity.AddressLine1);
                Assert.IsNotNullOrEmpty(clientConfig.CompanyInformationEntity.Locality);
                Assert.IsNotNullOrEmpty(clientConfig.CompanyInformationEntity.PostalTown);
                Assert.IsNotNullOrEmpty(clientConfig.CompanyInformationEntity.PostCode);
            }
        }
 public void WriteDefaultClientConfig()
 {
     var x = new DefaultClientsWrappers();
     x.Save();
     Assert.IsTrue(File.Exists(x.FullFileName));
 }