Thanks Brian.

I'll check out ColdMock.

Also, I'd like to see some Test CFC code for things like DAO's and
Business Objects. I have tests for things that do calculations and
return results but still thinking about ways to test a DAO. As its
only going to run on development and Staging environments inserting
test data to the database and deleting test data isn't a problem but
I'm sure theres a way that things can be wrapped in a transaction or
something so the database is left in the state it was in before
running the tests.

If anyone has any snippets or examples I would lbe interested in
seeing how others set them up.

On Sep 26, 4:04 pm, "Brian Kotek" <[EMAIL PROTECTED]> wrote:
> On 9/26/07, Alan <[EMAIL PROTECTED]> wrote:
>
>
>
> > Questions are:
>
> > 1) Is this a good approach?
>
> Looks like TDD to me. That's the idea. Write a test. Make it pass. Then
> refactor as needed, now that you can test that your refactoring didn't break
> something.
>
> 2) When unit testing the service CFC should I use the business object
>
> > it requires or mock it to ensure only the one CFC gets tested?
>
> I would definitely Mock everything that is not the object being tested. If
> you don't do this, now you're testing a dependency tree, not an individual
> component. If something blows up, you're not sure where it went wrong any
> more because there are multiple files being tested. This is the whole reason
> I created ColdMock. It only works on CF8 since it uses onMissingMethod(),
> but you could easily install CF8 locally and get the benefit even if you end
> up deploying to CF 7. If you're interested, it's at RIAForge.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CFCDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfcdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to