Saxonite v1.2.9

This commit is contained in:
Andy Howard
2022-10-12 13:51:56 +01:00
parent 0cab7c6a9d
commit 20addc0d92
2 changed files with 110 additions and 16 deletions
@@ -12,10 +12,42 @@ namespace Sarand.UnitTests.Core.Base.Utils
private Random random = new Random();
//-------------------------------------------------------------------
// P a d d i n g
// Properties.
//-------------------------------------------------------------------
[TestMethod]
public void StringUtil_PadLeft ()
public void StringUtil_IsEmpty()
{
// Leading spaces.
Assert.AreEqual(true, StringUtil.IsEmpty(null));
Assert.AreEqual(true, StringUtil.IsEmpty(""));
Assert.AreEqual(false, StringUtil.IsEmpty(" "));
Assert.AreEqual(false, StringUtil.IsEmpty("A"));
Assert.AreEqual(false, StringUtil.IsEmpty("Abc"));
Assert.AreEqual(true, "".IsEmpty());
Assert.AreEqual(false, "Abc".IsEmpty());
}
[TestMethod]
public void StringUtil_IsBlank()
{
// Leading spaces.
Assert.AreEqual(true, StringUtil.IsBlank(null));
Assert.AreEqual(true, StringUtil.IsBlank(""));
Assert.AreEqual(true, StringUtil.IsBlank(" "));
Assert.AreEqual(true, StringUtil.IsBlank(" "));
Assert.AreEqual(true, StringUtil.IsBlank(" \n\t "));
Assert.AreEqual(false, StringUtil.IsBlank("A"));
Assert.AreEqual(false, StringUtil.IsBlank("Abc"));
Assert.AreEqual(true, "".IsBlank());
Assert.AreEqual(true, " ".IsBlank());
Assert.AreEqual(false, "Abc".IsBlank());
}
//-------------------------------------------------------------------
// Padding.
//-------------------------------------------------------------------
[TestMethod]
public void StringUtil_PadLeft()
{
// Leading spaces.
Assert.AreEqual(" ", "".PadLeft(3, ' '));