Permalink
Browse files

Add JS tests of isNullOrEmpty

  • Loading branch information...
martinnormark committed Sep 7, 2012
1 parent df6b43b commit 248cd0f539cc96ed92a8795e30e832371779a683
Showing with 9 additions and 0 deletions.
  1. +9 −0 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');

0 comments on commit 248cd0f

Please sign in to comment.