30 lines
1.1 KiB
C#
30 lines
1.1 KiB
C#
using Elwig.Documents;
|
|
using Elwig.Helpers;
|
|
|
|
namespace Tests.DocumentTests {
|
|
[TestFixture]
|
|
public class DeliveryNoteTest {
|
|
|
|
[Test]
|
|
public async Task Test_01_OneDeliveryPart() {
|
|
using var ctx = new AppDbContext();
|
|
var d = await ctx.Deliveries.FindAsync(2020, 1);
|
|
using var doc = new DeliveryNote(d!, ctx);
|
|
var text = await Utils.GeneratePdfText(doc);
|
|
Assert.Multiple(() => {
|
|
Assert.That(text, Contains.Substring("""
|
|
MUSTERMANN Max
|
|
Winzerstraße 1
|
|
2223 Hohenruppersdorf
|
|
"""));
|
|
Assert.That(text, Contains.Substring("1472583")); // Betriebsnummer
|
|
Assert.That(text, Contains.Substring("pauschaliert"));
|
|
Assert.That(text, Contains.Substring($"Wolkersdorf, am {DateTime.Now:dd.MM.yyyy}"));
|
|
Assert.That(text, Contains.Substring("Traubenübernahmeschein Nr. 20201001X001"));
|
|
// TODO
|
|
Assert.That(text, Contains.Substring("Ich bin der Text, der auf einem Traubenübernahmeschein steht!"));
|
|
});
|
|
}
|
|
}
|
|
}
|