> Jim,
> Are you wanting to test the object without its dependencies, thus mocking
> it's dependencies?
> Or do you want to test it with its dependencies and wirings?
> This is key in to what approach you take!!
> ColdBox supports both with the introduction of MockBox. I myself usually
> test my model objects without external dependencies, and if they need some
> then I use MockBox to mock them to make my testing easier and nicer.
> http://blog.coldbox.org/post.cfm/mocking-objects-with-coldbox-annotat...
> I would give MockBox a shot. You can easily install it via Daily Build on
> coldbox 3.0.
> Also, the base test cases, have a getModel() method that can give you the
> object for testing. 3.0 really capitulizes on unit testing and will have
> even more support for this. Most of it is already on SVN for testing.
> This way, you can test with or without loading the virtual application.
> On Wed, Jun 24, 2009 at 9:00 AM, jim collins <jimcoll...@gmail.com> wrote:
> > I have an MXUnit test. I want to test the service object. The service
> > object uses ColdBox autowiring to set various things.
> > AFAIK this prevents me from using createobject in the MXUnit test as I
> > normally would.
> > In the Handler it looks like simply putting "<cfproperty
> > name="ServiceObject="model:ServiceObject" /> is enough to make Coldbox
> > create it w/the autowiring. If I put that line in my MXUnit file I get
> > an error "Element CBCONTROLLER is undefined in APPLICATION" . So my
> > question is how to I get access to an autowired object in my MXUnit
> > test?
> > BTW the MXUnit object extends
> > "coldbox.system.extras.testing.baseMXUnitTest"
> > Thanks,
> > Jim
> > On Jun 21, 3:29 pm, Luis Majano <lmaj...@gmail.com> wrote:
> > > Can you expand your question, what are you trying to do and where?
> > > On Sat, Jun 20, 2009 at 7:11 PM, jim collins <jimcoll...@gmail.com>
> > wrote:
> > > > Im using MXunit and theres a service object that gets autowired by
> > > > coldbox. How, in the test, do I tell coldbox "autowire the object and
> > > > give it to me"?
> > > --
> > > Luis F. Majano
> > > President
> > > Ortus Solutions, Corp
> > > ColdBox Platform:http://www.coldboxframework.com
> > > Linked In:http://www.linkedin.com/pub/3/731/483
> > > Blog:http://www.luismajano.com
> > > IECFUG Manager:http://www.iecfug.com
> --
> Luis F. Majano
> President
> Ortus Solutions, Corp
> ColdBox Platform:http://www.coldboxframework.com
> Linked In:http://www.linkedin.com/pub/3/731/483
> Blog:http://www.luismajano.com
> IECFUG Manager:http://www.iecfug.com