Author: ygrego Date: 2015-05-20 07:47:36 +0000 (Wed, 20 May 2015) New Revision: 1409 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1409 Log: Addition of tests methods about "setParentalControlStatus". Modified: oipf/js/test/ParentalControlManagerTest.js Modified: oipf/js/test/ParentalControlManagerTest.js =================================================================== --- oipf/js/test/ParentalControlManagerTest.js 2015-05-20 07:45:39 UTC (rev 1408) +++ oipf/js/test/ParentalControlManagerTest.js 2015-05-20 07:47:36 UTC (rev 1409) @@ -41,6 +41,62 @@ } }, + testSetParentalControlStatusWithValidPINAndTrue: function(resolve, reject) { + var result = this.parentalControlManagerObject + .setParentalControlStatus(this.PIN, true); + + console.log(result); + + if (this.assertEquals(result, 0)) { + resolve(); + } else { + reject(); + } + }, + + testSetParentalControlStatusWithValidPINAndFalse: function(resolve, reject) { + var result = this.parentalControlManagerObject + .setParentalControlStatus(this.PIN, false); + + console.log(result); + + if (this.assertEquals(result, 0)) { + resolve(); + } else { + reject(); + } + }, + + testSetParentalControlStatusWithInvalidPINAndTrue: function(resolve, reject) { + var result = this.parentalControlManagerObject + .setParentalControlStatus("5555", true); + + console.log(result); + + this.renderResultIfTrue(resolve, reject, this.assertEquals(result, 1)); + }, + + testSetParentalControlStatusWithInvalidPINAndFalse: function(resolve, reject) { + var result = this.parentalControlManagerObject + .setParentalControlStatus("5555", false); + + console.log(result); + + this.renderResultIfTrue(resolve, reject, this.assertEquals(result, 1)); + }, + + testSetParentalControlStatusWithInvalidOldPINAndValidNewPIN10Times: function(resolve, reject) { + for(var i = 0, li = 10; i < li; i++) { + var result = this.parentalControlManagerObject + .setParentalControlStatus("PIN", false); + + console.log(i+1, ":", result); + } + + this.renderResultIfTrue(resolve, reject, + this.assertEquals(result, this.PIN_LOCKED)); + }, + testVerifyParentalControlPINWithInvalidPIN10Times: function(resolve, reject) { for(var i = 0, li = 10; i < li; i++) { var result = this.parentalControlManagerObject
participants (1)
-
ygregoï¼ users.nuiton.org