public void Test_Print() { #region Arrange var cc = new CustomerConnector(); var ac = new ArticleConnector(); var tmpCustomer = cc.Create(new Customer() { Name = "TmpCustomer", CountryCode = "SE", City = "Testopolis" }); var tmpArticle = ac.Create(new Article() { Description = "TmpArticle", Type = ArticleType.Stock, PurchasePrice = 100 }); MyAssert.HasNoError(cc); MyAssert.HasNoError(ac); #endregion Arrange IInvoiceConnector connector = new InvoiceConnector(); var newInvoice = new Invoice() { CustomerNumber = tmpCustomer.CustomerNumber, InvoiceDate = new DateTime(2019, 1, 20), //"2019-01-20", DueDate = new DateTime(2019, 2, 20), //"2019-02-20", InvoiceType = InvoiceType.CashInvoice, PaymentWay = PaymentWay.Cash, Comments = "TestInvoice", InvoiceRows = new List <InvoiceRow>() { new InvoiceRow() { ArticleNumber = tmpArticle.ArticleNumber, DeliveredQuantity = 10, Price = 100 }, new InvoiceRow() { ArticleNumber = tmpArticle.ArticleNumber, DeliveredQuantity = 20, Price = 100 }, new InvoiceRow() { ArticleNumber = tmpArticle.ArticleNumber, DeliveredQuantity = 15, Price = 100 } } }; var createdInvoice = connector.Create(newInvoice); MyAssert.HasNoError(connector); var fileData = connector.Print(createdInvoice.DocumentNumber); MyAssert.HasNoError(connector); MyAssert.IsPDF(fileData); #region Delete arranged resources new CustomerConnector().Delete(tmpCustomer.CustomerNumber); new ArticleConnector().Delete(tmpArticle.ArticleNumber); #endregion Delete arranged resources }