PageRenderTime 3ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/SampleApplication/ColdBox3/test/integration/generalTest.cfc

http://github.com/bobsilverberg/ValidateThisColdBoxPlugin
ColdFusion CFScript | 55 lines | 29 code | 15 blank | 11 comment | 1 complexity | 96975454e0508fb12b8ebe2b5d4b8efb MD5 | raw file
 1<!-----------------------------------------------------------------------
 2Author 	 :	Luis Majano
 3Date     :	September 25, 2005
 4Description :
 5	Unit Tests integration for the ehGeneral Handler.
 6
 7----------------------------------------------------------------------->
 8<cfcomponent extends="coldbox.system.testing.BaseTestCase" output="false" appMapping="/cb_skeleton">
 9
10	<cffunction name="setUp" returntype="void" output="false">
11		<cfscript>
12		//Call the super setup method to setup the app.
13		super.setup();
14		
15		//EXECUTE THE APPLICATION START HANDLER: UNCOMMENT IF NEEDED AND FILL IT OUT.
16		//getController().runEvent("main.onAppInit");
17
18		//EXECUTE THE ON REQUEST START HANDLER: UNCOMMENT IF NEEDED AND FILL IT OUT
19		//getController().runEvent("main.onRequestStart");
20		</cfscript>
21	</cffunction>
22	
23	<cffunction name="testindex" returntype="void" output="false">
24		<cfscript>
25		var event = "";
26		
27		//Place any variables on the form or URL scope to test the handler.
28		//FORM.name = "luis"
29		event = execute("general.index");
30		
31		debug(event.getCollection());
32		
33		//Do your asserts below
34		assertEquals("Welcome to ColdBx!", event.getValue("welcomeMessage",""), "Failed to assert welcome message");
35			
36		</cfscript>
37	</cffunction>
38	
39	<cffunction name="testdoSomething" returntype="void" output="false">
40		<cfscript>
41		var event = "";
42		
43		//Place any variables on the form or URL scope to test the handler.
44		//FORM.name = "luis"
45		event = execute("general.doSomething");
46		
47		debug(event.getCollection());
48			
49		//Do your asserts below for setnextevent you can test for a setnextevent boolean flag
50		assertEquals("general.index", event.getValue("setnextevent",""), "Relocation Test");
51			
52		</cfscript>
53	</cffunction>
54	
55</cfcomponent>