PageRenderTime 7ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 1ms

/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
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cfset cache = CreateObject("component", "wheels.Cache").init()>
 4
 5	<cffunction name="setup">
 6		<cfset cache.clear()>
 7		<cfset StructDelete(variables, "result")>
 8		<cfset StructDelete(variables, "results")>
 9	</cffunction>
10
11	<cffunction name="testOneValue">
12		<cfset cache.add(key="1", value="a")>
13		<cfset result = cache.count()>
14		<cfset assert("result IS 1")>
15	</cffunction>
16
17	<cffunction name="testMultipleAndComplexValues">
18		<cfset var loc = {}>
19		<cfset loc.aQuery = QueryNew("col1,col2")>
20		<cfset cache.add(key="1", value="a")>
21		<cfset cache.add(key="2", value="b")>
22		<cfset cache.add(key="3", value=loc.aQuery)>
23		<cfset result = cache.count()>
24		<cfset assert("result IS 3")>
25	</cffunction>
26
27</cfcomponent>