PageRenderTime 41ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/wheels/tests/model/raisedErrors/raisedErrors.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 30 lines | 26 code | 4 blank | 0 comment | 0 complexity | 485be72e756002259defe019762ff4cc MD5 | raw file
Possible License(s): Apache-2.0, CPL-1.0
  1. <cfcomponent extends="wheelsMapping.Test">
  2. <cffunction name="test_table_not_found">
  3. <cfset loc.e = raised("model('table_not_found')")>
  4. <cfset debug("loc.e", false)>
  5. <cfset loc.r = "Wheels.TableNotFound">
  6. <cfset assert("loc.e eq loc.r")>
  7. </cffunction>
  8. <cffunction name="test_no_primary_key">
  9. <cfset loc.e = raised("model('noPrimaryKey')")>
  10. <cfset debug("loc.e", false)>
  11. <cfset loc.r = "Wheels.NoPrimaryKey">
  12. <cfset assert("loc.e eq loc.r")>
  13. </cffunction>
  14. <cffunction name="test_bykey_methods_should_raise_error_with_key_argument">
  15. <cfset post = model("post")>
  16. <cfset loc.e = raised('post.deleteByKey(key="1,2")')>
  17. <cfset loc.r = "Wheels.InvalidArgumentValue">
  18. <cfset assert("loc.e eq loc.r")>
  19. <cfset loc.e = raised('post.findByKey(key="1,2")')>
  20. <cfset loc.r = "Wheels.InvalidArgumentValue">
  21. <cfset assert("loc.e eq loc.r")>
  22. <cfset loc.e = raised('post.updateByKey(key="1,2", title="testing")')>
  23. <cfset loc.r = "Wheels.InvalidArgumentValue">
  24. <cfset assert("loc.e eq loc.r")>
  25. </cffunction>
  26. </cfcomponent>