mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 16:59:35 +01:00
Add 2 more vertical Draw tests (22 test cases total)
Co-authored-by: tig <585482+tig@users.noreply.github.com>
This commit is contained in:
@@ -3472,62 +3472,6 @@ public class TextFormatterTests
|
||||
Assert.Equal (expectedY, rect.Y);
|
||||
}
|
||||
|
||||
[SetupFakeDriver]
|
||||
[Theory]
|
||||
[InlineData ("A", 1, 0, "")]
|
||||
[InlineData ("A", 0, 1, "")]
|
||||
[InlineData ("AB1 2", 1, 2, "2")]
|
||||
[InlineData ("AB12", 1, 5, "2\n1\nB\nA")]
|
||||
[InlineData ("AB\n12", 2, 5, "B2\nA1")]
|
||||
[InlineData ("ABC 123 456", 2, 7, "6C\n5B\n4A\n \n3 \n2 \n1 ")]
|
||||
[InlineData ("こんにちは", 1, 1, "")]
|
||||
[InlineData ("こんにちは", 2, 1, "は")]
|
||||
[InlineData ("こんにちは", 2, 5, "は\nち\nに\nん\nこ")]
|
||||
[InlineData ("こんにちは", 2, 10, "は\nち\nに\nん\nこ")]
|
||||
[InlineData ("こんにちは\nAB\n12", 4, 10, "はB2\nちA1\nに \nん \nこ ")]
|
||||
public void Draw_Vertical_BottomTop_LeftRight (string text, int width, int height, string expectedText)
|
||||
{
|
||||
TextFormatter tf = new ()
|
||||
{
|
||||
Text = text,
|
||||
Direction = TextDirection.BottomTop_LeftRight
|
||||
};
|
||||
|
||||
tf.ConstrainToWidth = width;
|
||||
tf.ConstrainToHeight = height;
|
||||
tf.Draw (new (0, 0, width, height), Attribute.Default, Attribute.Default);
|
||||
|
||||
DriverAssert.AssertDriverContentsWithFrameAre (expectedText, _output);
|
||||
}
|
||||
|
||||
[SetupFakeDriver]
|
||||
[Theory]
|
||||
[InlineData ("A", 1, 0, "")]
|
||||
[InlineData ("A", 0, 1, "")]
|
||||
[InlineData ("AB1 2", 1, 2, "2")]
|
||||
[InlineData ("AB12", 1, 5, "2\n1\nB\nA")]
|
||||
[InlineData ("AB\n12", 2, 5, "2B\n1A")]
|
||||
[InlineData ("ABC 123 456", 2, 7, "C6\nB5\nA4\n \n 3\n 2\n 1")]
|
||||
[InlineData ("こんにちは", 1, 1, "")]
|
||||
[InlineData ("こんにちは", 2, 1, "は")]
|
||||
[InlineData ("こんにちは", 2, 5, "は\nち\nに\nん\nこ")]
|
||||
[InlineData ("こんにちは", 2, 10, "は\nち\nに\nん\nこ")]
|
||||
[InlineData ("こんにちは\nAB\n12", 4, 10, "2Bは\n1Aち\n に\n ん\n こ")]
|
||||
public void Draw_Vertical_BottomTop_RightLeft (string text, int width, int height, string expectedText)
|
||||
{
|
||||
TextFormatter tf = new ()
|
||||
{
|
||||
Text = text,
|
||||
Direction = TextDirection.BottomTop_RightLeft
|
||||
};
|
||||
|
||||
tf.ConstrainToWidth = width;
|
||||
tf.ConstrainToHeight = height;
|
||||
tf.Draw (new (0, 0, width, height), Attribute.Default, Attribute.Default);
|
||||
|
||||
DriverAssert.AssertDriverContentsWithFrameAre (expectedText, _output);
|
||||
}
|
||||
|
||||
// Draw tests - Note that these depend on View
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user