PageRenderTime 114ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/wheels/tests/cache/Count.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 27 lines | 22 code | 5 blank | 0 comment | 0 complexity | 6ec2b828ba5bd73ab5ace02ef5b1c83c MD5 | raw file
Possible License(s): Apache-2.0, CPL-1.0
  1. <cfcomponent extends="wheelsMapping.Test">
  2. <cfset cache = CreateObject("component", "wheels.Cache").init()>
  3. <cffunction name="setup">
  4. <cfset cache.clear()>
  5. <cfset StructDelete(variables, "result")>
  6. <cfset StructDelete(variables, "results")>
  7. </cffunction>
  8. <cffunction name="testOneValue">
  9. <cfset cache.add(key="1", value="a")>
  10. <cfset result = cache.count()>
  11. <cfset assert("result IS 1")>
  12. </cffunction>
  13. <cffunction name="testMultipleAndComplexValues">
  14. <cfset var loc = {}>
  15. <cfset loc.aQuery = QueryNew("col1,col2")>
  16. <cfset cache.add(key="1", value="a")>
  17. <cfset cache.add(key="2", value="b")>
  18. <cfset cache.add(key="3", value=loc.aQuery)>
  19. <cfset result = cache.count()>
  20. <cfset assert("result IS 3")>
  21. </cffunction>
  22. </cfcomponent>