PageRenderTime 12ms CodeModel.GetById 1ms RepoModel.GetById 0ms 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. <!-----------------------------------------------------------------------
  2. Author : Luis Majano
  3. Date : September 25, 2005
  4. Description :
  5. Unit Tests integration for the ehGeneral Handler.
  6. ----------------------------------------------------------------------->
  7. <cfcomponent extends="coldbox.system.testing.BaseTestCase" output="false" appMapping="/cb_skeleton">
  8. <cffunction name="setUp" returntype="void" output="false">
  9. <cfscript>
  10. //Call the super setup method to setup the app.
  11. super.setup();
  12. //EXECUTE THE APPLICATION START HANDLER: UNCOMMENT IF NEEDED AND FILL IT OUT.
  13. //getController().runEvent("main.onAppInit");
  14. //EXECUTE THE ON REQUEST START HANDLER: UNCOMMENT IF NEEDED AND FILL IT OUT
  15. //getController().runEvent("main.onRequestStart");
  16. </cfscript>
  17. </cffunction>
  18. <cffunction name="testindex" returntype="void" output="false">
  19. <cfscript>
  20. var event = "";
  21. //Place any variables on the form or URL scope to test the handler.
  22. //FORM.name = "luis"
  23. event = execute("general.index");
  24. debug(event.getCollection());
  25. //Do your asserts below
  26. assertEquals("Welcome to ColdBx!", event.getValue("welcomeMessage",""), "Failed to assert welcome message");
  27. </cfscript>
  28. </cffunction>
  29. <cffunction name="testdoSomething" returntype="void" output="false">
  30. <cfscript>
  31. var event = "";
  32. //Place any variables on the form or URL scope to test the handler.
  33. //FORM.name = "luis"
  34. event = execute("general.doSomething");
  35. debug(event.getCollection());
  36. //Do your asserts below for setnextevent you can test for a setnextevent boolean flag
  37. assertEquals("general.index", event.getValue("setnextevent",""), "Relocation Test");
  38. </cfscript>
  39. </cffunction>
  40. </cfcomponent>