Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add JS tests of isNullOrEmpty

  • Loading branch information...
commit 248cd0f539cc96ed92a8795e30e832371779a683 1 parent df6b43b
@martinnormark martinnormark authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 tests/CoreLib/TestString.htm
View
9 tests/CoreLib/TestString.htm
@@ -85,6 +85,15 @@ <h2 id="qunit-userAgent"></h2>
QUnit.equal('&lt;h1&gt;a &quot;aaa&quot; &amp; a &quot;bbb&quot;&lt;/h1&gt;'.htmlDecode(), '<h1>a "aaa" & a "bbb"</h1>');
});
+test('isNullOrEmpty', function () {
+ QUnit.equal(String.isNullOrEmpty(null), true, 'null should be true');
+ QUnit.equal(String.isNullOrEmpty(undefined), true, 'undefined should be true');
+ QUnit.equal(String.isNullOrEmpty(), true, 'no param, should be true');
+ QUnit.equal(String.isNullOrEmpty(""), true, 'empty string, should be true');
+ QUnit.equal(String.isNullOrEmpty(" "), false, 'white space, should be false');
+ QUnit.equal(String.isNullOrEmpty("aaa"), false, 'aaa, should be false');
+});
+
test('isNullOrWhiteSpace', function () {
QUnit.equal(String.isNullOrWhiteSpace(null), true, 'null should be true');
QUnit.equal(String.isNullOrWhiteSpace(undefined), true, 'undefined should be true');
Please sign in to comment.
Something went wrong with that request. Please try again.