PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms 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
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cffunction name="test_table_not_found">
 4		<cfset loc.e = raised("model('table_not_found')")>
 5		<cfset debug("loc.e", false)>
 6		<cfset loc.r = "Wheels.TableNotFound">
 7		<cfset assert("loc.e eq loc.r")>
 8	</cffunction>
 9
10	<cffunction name="test_no_primary_key">
11		<cfset loc.e = raised("model('noPrimaryKey')")>
12		<cfset debug("loc.e", false)>
13		<cfset loc.r = "Wheels.NoPrimaryKey">
14		<cfset assert("loc.e eq loc.r")>
15	</cffunction>
16
17	<cffunction name="test_bykey_methods_should_raise_error_with_key_argument">
18		<cfset post = model("post")>
19		<cfset loc.e = raised('post.deleteByKey(key="1,2")')>
20		<cfset loc.r = "Wheels.InvalidArgumentValue">
21		<cfset assert("loc.e eq loc.r")>
22		<cfset loc.e = raised('post.findByKey(key="1,2")')>
23		<cfset loc.r = "Wheels.InvalidArgumentValue">
24		<cfset assert("loc.e eq loc.r")>
25		<cfset loc.e = raised('post.updateByKey(key="1,2", title="testing")')>
26		<cfset loc.r = "Wheels.InvalidArgumentValue">
27		<cfset assert("loc.e eq loc.r")>
28	</cffunction>
29
30</cfcomponent>