Skip to content

Commit 708530f

Browse files
authored
Merge pull request #1101 from nunit/stringassertadditions
Added new string assert functions
2 parents d7f76c4 + a3e8801 commit 708530f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/articles/nunit/writing-tests/assertions/classic-assertions/String-Assert.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,23 @@ StringAssert.IsMatch(string regexPattern, string actual,
4343
StringAssert.DoesNotMatch(string regexPattern, string actual);
4444
StringAssert.DoesNotMatch(string regexPattern, string actual,
4545
string message, params object[] args);
46+
47+
// Functions below are available in NUnit 4.5 and later
48+
StringAssert.IsNullOrEmpty(string? actual);
49+
StringAssert.IsNullOrEmpty(string? actual,
50+
string message, params object[] args);
51+
52+
StringAssert.IsNotNullNorEmpty(string? actual);
53+
StringAssert.IsNotNullNorEmpty(string? actual,
54+
string message, params object[] args);
55+
56+
StringAssert.IsNullOrWhiteSpace(string? actual);
57+
StringAssert.IsNullOrWhiteSpace(string? actual,
58+
string message, params object[] args);
59+
60+
StringAssert.IsNotNullNorWhiteSpace(string? actual);
61+
StringAssert.IsNotNullNorWhiteSpace(string? actual,
62+
string message, params object[] args);
4663
```
4764

4865
## See Also

0 commit comments

Comments
 (0)