public void TestCreate_One_Product_Pizza() { // Arrange IRechnungService rechnung = new RechnungService(); RechnungData data = new RechnungData { Kunde = "Metzgerei Siegfried", AdressZeile1 = "Bottigenstrasse 22", AdressZeile2 = "3018 Bern", RechnungsDatum = DateTime.Today, LieferDatum = DateTime.Today, RechnungsNummer = "0079", EinzelpreisPizza = 10.00m, TotalPizza = 20.00m, MengePizza = 2, SubTotal = 20.00m, Total = 20.00m }; // Act DocX document = rechnung.Create(data); document.SaveAs(FILE_NAME); // Assert Assert.IsNotNull(document); Assert.IsTrue(File.Exists(FILE_NAME)); Assert.IsFalse(document.Tables.Any(x => x.Rows.Any(y => y.Cells.Any(p => p.Paragraphs.Any(t => t.Text.Contains(Bearfoods.BBQ)))))); Assert.IsFalse(document.Tables.Any(x => x.Rows.Any(y => y.Cells.Any(p => p.Paragraphs.Any(t => t.Text.Contains(Bearfoods.Jus)))))); Assert.IsTrue(document.Tables.Any(x => x.Rows.Any(y => y.Cells.Any(p => p.Paragraphs.Any(t => t.Text.Contains(Bearfoods.Pizza)))))); }
public void TestCreate_Full() { // Arrange IRechnungService rechnung = new RechnungService(); RechnungData data = CreateRechnungData(); // Act DocX document = rechnung.Create(data); document.SaveAs(FILE_NAME); // Assert Assert.IsNotNull(document); Assert.IsTrue(File.Exists(FILE_NAME)); }