/SampleApplication/ColdBox3/test/integration/generalTest.cfc
ColdFusion CFScript | 55 lines | 29 code | 15 blank | 11 comment | 1 complexity | 96975454e0508fb12b8ebe2b5d4b8efb MD5 | raw file
- <!-----------------------------------------------------------------------
- Author : Luis Majano
- Date : September 25, 2005
- Description :
- Unit Tests integration for the ehGeneral Handler.
- ----------------------------------------------------------------------->
- <cfcomponent extends="coldbox.system.testing.BaseTestCase" output="false" appMapping="/cb_skeleton">
- <cffunction name="setUp" returntype="void" output="false">
- <cfscript>
- //Call the super setup method to setup the app.
- super.setup();
-
- //EXECUTE THE APPLICATION START HANDLER: UNCOMMENT IF NEEDED AND FILL IT OUT.
- //getController().runEvent("main.onAppInit");
- //EXECUTE THE ON REQUEST START HANDLER: UNCOMMENT IF NEEDED AND FILL IT OUT
- //getController().runEvent("main.onRequestStart");
- </cfscript>
- </cffunction>
-
- <cffunction name="testindex" returntype="void" output="false">
- <cfscript>
- var event = "";
-
- //Place any variables on the form or URL scope to test the handler.
- //FORM.name = "luis"
- event = execute("general.index");
-
- debug(event.getCollection());
-
- //Do your asserts below
- assertEquals("Welcome to ColdBx!", event.getValue("welcomeMessage",""), "Failed to assert welcome message");
-
- </cfscript>
- </cffunction>
-
- <cffunction name="testdoSomething" returntype="void" output="false">
- <cfscript>
- var event = "";
-
- //Place any variables on the form or URL scope to test the handler.
- //FORM.name = "luis"
- event = execute("general.doSomething");
-
- debug(event.getCollection());
-
- //Do your asserts below for setnextevent you can test for a setnextevent boolean flag
- assertEquals("general.index", event.getValue("setnextevent",""), "Relocation Test");
-
- </cfscript>
- </cffunction>
-
- </cfcomponent>