-
Notifications
You must be signed in to change notification settings - Fork 346
Expand file tree
/
Copy pathStringHelperTest.cs
More file actions
47 lines (42 loc) · 1.67 KB
/
StringHelperTest.cs
File metadata and controls
47 lines (42 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Collections;
using System.Collections.Generic;
using NUnit.Framework;
namespace FileHelpers.Tests
{
/// <summary>
/// FileHelpers Helpers STringHelper tests
/// </summary>
[TestFixture]
class StringHelperTest
{
[Test(Description="String without spaces into RemoveBlanks")]
public void RemoveNoBlanks()
{
StringHelper.RemoveBlanks("+41").AssertEqualTo("+41");
}
[Test(Description = "String with leading blanks into RemoveBlanks")]
public void RemoveLeadingBlanks()
{
StringHelper.RemoveBlanks(" +41").AssertEqualTo(" +41");
}
[Test(Description = "String with blanks after sign logic into RemoveBlanks")]
public void RemoveBlanksAfterSign()
{
StringHelper.RemoveBlanks(" + 41").AssertEqualTo("+41");
}
[Test(Description = "String with trailing blank into RemoveBlanks")]
public void RemoveTrailingBlanks()
{
StringHelper.RemoveBlanks(" + 41").AssertEqualTo("+41");
}
[Test (Description = "String IsNullOrWhiteSpace help method tests")]
public void IsNullOrWhiteSpace ()
{
StringHelper.IsNullOrWhiteSpace (" ").AssertEqualTo (true, "WhiteSpaces not detected");
StringHelper.IsNullOrWhiteSpace (null).AssertEqualTo (true, "null string not detected");
StringHelper.IsNullOrWhiteSpace (String.Empty).AssertEqualTo (true, "empty string not detected");
StringHelper.IsNullOrWhiteSpace (" test ").AssertEqualTo (false, "valid string not detected");
}
}
}