mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 16:59:35 +01:00
Add Draw_Vertical_TopBottom_LeftRight test (3 test cases)
Co-authored-by: tig <585482+tig@users.noreply.github.com>
This commit is contained in:
@@ -3255,5 +3255,34 @@ public class TextFormatterTests
|
||||
Assert.Equal (expectedText, actualText);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData ("", 5, 1, "")]
|
||||
[InlineData (
|
||||
"Hello Worlds",
|
||||
1,
|
||||
12,
|
||||
"H\ne\nl\nl\no\n\nW\no\nr\nl\nd\ns")]
|
||||
[InlineData ("Hello Worlds", 12, 1, @"HelloWorlds")]
|
||||
public void Draw_Vertical_TopBottom_LeftRight (string text, int width, int height, string expectedText)
|
||||
{
|
||||
// Create a local driver instance for this test
|
||||
var factory = new FakeDriverFactory ();
|
||||
var driver = factory.Create ();
|
||||
driver.SetBufferSize (Math.Max (25, 20), Math.Max (25, 20));
|
||||
|
||||
TextFormatter tf = new ()
|
||||
{
|
||||
Text = text,
|
||||
Direction = TextDirection.TopBottom_LeftRight
|
||||
};
|
||||
|
||||
tf.ConstrainToWidth = width;
|
||||
tf.ConstrainToHeight = height;
|
||||
tf.Draw (new Rectangle (0, 0, 20, 20), Attribute.Default, Attribute.Default, driver: driver);
|
||||
|
||||
string actualText = GetDriverContents (driver, width, height);
|
||||
Assert.Equal (expectedText, actualText);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user