Ejemplo n.º 1
0
        public void UpdateAndEmail()
        {
            InvoiceProxy proxy = new InvoiceProxy();

            InvoiceDto dto1 = this.GetServiceSale();
            proxy.Insert(dto1);

            int invoiceUid = dto1.Uid;
            string lastUpdatedUid = dto1.LastUpdatedUid;
            string invoiceNumber = dto1.InvoiceNumber;

            dto1 = this.GetServiceSale2();
            dto1.Uid = invoiceUid;
            dto1.LastUpdatedUid = lastUpdatedUid;
            dto1.InvoiceNumber = invoiceNumber;

            EmailMessageDto emailMessage = new EmailMessageDto();
            emailMessage.From = ConfigurationSettings.AppSettings["NUnitTests.Email.From"];
            emailMessage.To = ConfigurationSettings.AppSettings["NUnitTests.Email.To"];
            emailMessage.Subject = "Invoice - Sent using NetAccounts OLA REST API (TestUpdateAndEmail).";
            emailMessage.Body = "Update Invoice then email.";

            proxy.UpdateAndEmail(dto1, this.IncTaxTemplateUid, emailMessage);

            InvoiceDto dto2 = (InvoiceDto)proxy.GetByUid(dto1.Uid);

            AssertEqual(dto1, dto2);
        }