/js/lib/Socket.IO-node/support/expresso/deps/jscoverage/doc/example-jsunit/jsunit/app/jsUnitTestSuite.js

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs · JavaScript · 44 lines · 36 code · 8 blank · 0 comment · 2 complexity · 3fd174549cb24cf919e448c1f3e60aa6 MD5 · raw file

  1. function jsUnitTestSuite() {
  2. this.isjsUnitTestSuite = true;
  3. this.testPages = Array();
  4. this.pageIndex = 0;
  5. }
  6. jsUnitTestSuite.prototype.addTestPage = function (pageName)
  7. {
  8. this.testPages[this.testPages.length] = pageName;
  9. }
  10. jsUnitTestSuite.prototype.addTestSuite = function (suite)
  11. {
  12. for (var i = 0; i < suite.testPages.length; i++)
  13. this.addTestPage(suite.testPages[i]);
  14. }
  15. jsUnitTestSuite.prototype.containsTestPages = function ()
  16. {
  17. return this.testPages.length > 0;
  18. }
  19. jsUnitTestSuite.prototype.nextPage = function ()
  20. {
  21. return this.testPages[this.pageIndex++];
  22. }
  23. jsUnitTestSuite.prototype.hasMorePages = function ()
  24. {
  25. return this.pageIndex < this.testPages.length;
  26. }
  27. jsUnitTestSuite.prototype.clone = function ()
  28. {
  29. var clone = new jsUnitTestSuite();
  30. clone.testPages = this.testPages;
  31. return clone;
  32. }
  33. if (xbDEBUG.on)
  34. {
  35. xbDebugTraceObject('window', 'jsUnitTestSuite');
  36. }