How to mock method having argument call by reference.

Hello Guys,
Recently I have started working with Mockbox and stuck at one level.
Basically I am trying to create unit test for service layer where
mocking DAO object. Mocking work great for me but in "Create" method
of DAO I have passed bean as argument and function return true/false
also this function add record into database and assign auto generated
id back to passed arguments so I can use in service layer.

But I am not sure how to mock such method so my passed bean object in
unit test have id that I want in mock.


Can you post the service layer code in question please

Below is contentDAO and contentService code I have just kept only
require to add content. Basically I want to store id in event table
whenever new content is added into database.

<cfcomponent displayname="contentDAO" hint="table ID column = id">
       <cffunction name="create" access="public" output="false"
    <cfargument name="content" type="content" required="true" />

    <cfset var qCreate = "" />
      <cfquery name="qCreate" datasource="#variables.dsn#">
        INSERT INTO content
          (status, html)
          <cfqueryparam value="#arguments.content.getstatus()#"
CFSQLType="cf_sql_bit" null="#not
len(arguments.content.getstatus())#" />,
          <cfqueryparam value="#arguments.content.gethtml()#"
CFSQLType="cf_sql_longvarchar" null="#not
len(arguments.content.gethtml())#" />
          select @@identity as id
      <cfset arguments.content.setId(>
      <cfcatch type="database">
        <cfreturn false />
    <cfreturn true />

<cfcomponent name="contentService" output="false" cache="true"
  <cfproperty name="contentDAO" inject="model:contentDAO"
  <cfproperty name="contentGateway" inject="model:contentGateway"
         <cfproperty name="eventService" inject="model:eventService"
         <cffunction name="savecontent" access="public" output="false"
         <cfargument name="content" type="content" required="true" />
                <cfset var issuccess =>
                <cfif issuccess>
                     <cfset events.addNewEvent("New content added with
id:" & arguments.content.getId())>
    <cfreturn issuccess />