Templating: TEXT mit w= für zentrierte und rechtsbündige Zeilen
CI / build-and-test (push) Canceled after 0s
CI / build-and-test (push) Canceled after 0s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
98c5f9eba0
commit
d1f3dd5148
4 files changed
+52
-2
No files matched your search
@@ -197,6 +197,25 @@ public sealed class TemplatingTests : IDisposable
|
||||
|| issue.Message.Contains("keine Zahl", StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LayoutParser_LiestTextBreiteFuerZentrierung()
|
||||
{
|
||||
var layout = new LayoutParser().Parse("PAGE 210 297 mm\nTEXT 0 20 \"Titel $Name\" w=210 align=center");
|
||||
|
||||
var text = Assert.IsType<TextElement>(Assert.Single(layout.Elements));
|
||||
Assert.Equal("210", text.Attributes["w"]);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("w=0")]
|
||||
[InlineData("w=-5")]
|
||||
[InlineData("w=abc")]
|
||||
public void LayoutParser_LehntUngueltigeTextBreiteAb(string attribute)
|
||||
{
|
||||
Assert.Throws<TemplateValidationException>(() =>
|
||||
new LayoutParser().Parse($"PAGE 210 297 mm\nTEXT 0 20 \"Titel\" {attribute}"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void LayoutParser_MeldetAlleSyntaxfehlerMitZeilen()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user