Author: ygrego Date: 2015-02-16 17:12:21 +0000 (Mon, 16 Feb 2015) New Revision: 807 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/807 Log: Including of assert method to validate methods tests. Modified: oipf/js/test/VideoBroadcastTest.js Modified: oipf/js/test/VideoBroadcastTest.js =================================================================== --- oipf/js/test/VideoBroadcastTest.js 2015-02-16 11:18:26 UTC (rev 806) +++ oipf/js/test/VideoBroadcastTest.js 2015-02-16 17:12:21 UTC (rev 807) @@ -3,9 +3,26 @@ * This class gather a set of method necessary to test a video broadcast object. * */ -var VideoBroadcastTest = Class.extend({ - - +var VideoBroadcastTest = TestCase.extend({ + + testsDescriptions: [{ + name : VideoBroadcastObject, + object : "", + tests : [{ + id : METH_ID_TEST_VB_INSTANCE_CREATION, + label : LABEL_TEST_VB_TEST_INSTANCE_CREATION, + method : METH_NAME_TEST_VB_INSTANCE_CREATION, + result : "" + }, + { + id : METH_ID_TEST_BIND_TO_CURRENT_CHANNEL, + label : LABEL_TEST_BIND_TO_CURRENT_CHANNEL, + method :METH_NAME_TEST_BIND_TO_CURRENT_CHANNEL, + result : "" + } + ] + }], + videoBroadcastObject: null, init: function() { @@ -15,29 +32,35 @@ * Descrtiption: * This method test the initialization of video broadcast object. */ - instanceCreation: function() { - var METHOD_NAME = "instanceCreation"; - var ID = INSTANCE_CREATION_TEST_CONSTANTS+" :VB"; + testInstanceCreation: function() { var state = "Pending"; - console.log("[TEST-RUNNING][Info] "+"Id: "+ID+", Label: "+INSTANCE_CREATION_TEST_CONSTANTS+", State: "+state); + console.log("[TEST-RUNNING][Info] "+"Id: "+METH_ID_TEST_VB_INSTANCE_CREATION+", Label: "+LABEL_TEST_VB_TEST_INSTANCE_CREATION+", State: "+state); this.videoBroadcastObject = oipfObjectFactory.createVideoBroadcastObject(); - if ((this.videoBroadcastObject !== null) && (this.videoBroadcastObject !== undefined)) { - - var result = "Success"; - } else { - result = "Failed"; - } + + this.assertNotNull(this.videoBroadcastObject); + this.assertNotUndefined(this.videoBroadcastObject); + state = "Finished"; - console.log("[TEST-RUNNING][Info] "+"Id: "+ID+", Label: "+this.INSTANCE_CREATION+", State: "+state); + console.log("[TEST-RUNNING][Info] "+"Id: "+METH_ID_TEST_VB_INSTANCE_CREATION+", Label: "+LABEL_TEST_VB_TEST_INSTANCE_CREATION+", State: "+state); + + return true; + }, + + /* + * Descrtiption: + * This method test the binding between the video broadcast object and the current program stream. + */ + testBindToCurrentChannel: function() { + var state = "Pending"; + console.log("[TEST-RUNNING][Info] "+"Id: "+METH_ID_TEST_BIND_TO_CURRENT_CHANNEL+", Label: "+LABEL_TEST_BIND_TO_CURRENT_CHANNEL+", State: "+state); + var currentChann = this.videoBroadcastObject.bindToCurrentChannel(); - var testCase = [{ - "id" : ID, - "label" : this.INSTANCE_CREATION, - "method" : METHOD_NAME, - "result" : result - }]; - - return testCase; + this.assertEquals(this.videoBroadcastObject.currentChannel, currentChann); + + state = "Finished"; + console.log("[TEST-RUNNING][Info] "+"Id: "+METH_ID_TEST_BIND_TO_CURRENT_CHANNEL+", Label: "+LABEL_TEST_BIND_TO_CURRENT_CHANNEL+", State: "+state); + + return true; } }); \ No newline at end of file