mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Fixing tests...
This commit is contained in:
@@ -154,6 +154,32 @@ public class TextFormatterTests
|
||||
Assert.Equal (new (0, 0, width, height), TextFormatter.CalcRect (0, 0, text, textDirection));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData ("test", TextDirection.LeftRight_TopBottom)]
|
||||
[InlineData (" ~ s gui.cs master ↑10", TextDirection.LeftRight_TopBottom)]
|
||||
[InlineData ("Say Hello view4 你", TextDirection.LeftRight_TopBottom)]
|
||||
[InlineData ("Say Hello view4 你", TextDirection.RightLeft_TopBottom)]
|
||||
[InlineData ("Say Hello view4 你", TextDirection.LeftRight_BottomTop)]
|
||||
[InlineData ("Say Hello view4 你", TextDirection.RightLeft_BottomTop)]
|
||||
public void CalcRect_Horizontal_Width_Correct (string text, TextDirection textDirection)
|
||||
{
|
||||
// The width is the number of columns in the text
|
||||
Assert.Equal (new Size ( text.GetColumns (), 1), TextFormatter.CalcRect (0, 0, text, textDirection).Size);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData ("test", TextDirection.TopBottom_LeftRight)]
|
||||
[InlineData (" ~ s gui.cs master ↑10", TextDirection.TopBottom_LeftRight)]
|
||||
[InlineData ("Say Hello view4 你", TextDirection.TopBottom_LeftRight)]
|
||||
[InlineData ("Say Hello view4 你", TextDirection.TopBottom_RightLeft)]
|
||||
[InlineData ("Say Hello view4 你", TextDirection.BottomTop_LeftRight)]
|
||||
[InlineData ("Say Hello view4 你", TextDirection.BottomTop_RightLeft)]
|
||||
public void CalcRect_Vertical_Height_Correct (string text, TextDirection textDirection)
|
||||
{
|
||||
// The height is based both the number of lines and the number of wide chars
|
||||
Assert.Equal (new Size (1 + text.GetColumns() - text.Length, text.Length), TextFormatter.CalcRect (0, 0, text, textDirection).Size);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData ("")]
|
||||
[InlineData (null)]
|
||||
|
||||
Reference in New Issue
Block a user