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