Fixing tests...

This commit is contained in:
Tig
2024-04-18 13:14:22 -06:00
parent a48146af82
commit f3b5ed7afc
7 changed files with 454 additions and 417 deletions

View File

@@ -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)]