mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-29 17:28:01 +01:00
Add unit test to prove that null and empty string doesn't not throws anything.
This commit is contained in:
@@ -64,4 +64,19 @@ public class StringTests
|
||||
var str = "\u200D";
|
||||
Assert.Equal (0, str.GetColumns ());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData (null)]
|
||||
[InlineData ("")]
|
||||
public void TestGetColumns_Does_Not_Throws_With_Null_And_Empty_String (string? text)
|
||||
{
|
||||
if (text is null)
|
||||
{
|
||||
Assert.Equal (0, StringExtensions.GetColumns (text!));
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert.Equal (0, text.GetColumns ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user