On Friday, July 4, 2003, at 04:55 AM, Andre Mohamed wrote: > Although I haven't got the DRK or seen the code for CFUnit, what I > gather from Christian's article is that the CFUnit "framework" is > merely > just one single CFC
There are two components: test_case.cfc and test_suite.cfc. Test case is the base component for all cfunit tests, and test_suite allows you to bundle multiple test cases into a set, and run them all together. > it is vastly simplified compared with JUnit. ColdFusion components are vastly simplified compared to Java objects, therefore I think a vastly simplified testing framework is appropriate. > These assertion methods are presumably fairly > trivial and comprise of things like assertEquals, assertTrue etc. There are about 10 assert functions. > Obviously you can add your own assert methods to the base class as > needed. Absolutely. They are very easy to add. > I could be way off because as I said I haven't seen the implementation > of CFUnit but I think that's pretty much it You're pretty close! > i.e. ONE CFC! And no where > near as complex as JUnit. No, it is not nearly as complex as JUnit. JUnit is designed to solve much more complex problems. CFUnit is designed to introduce the concept of unit testing to ColdFusion developers and provide them with a sound, straightforward implementation which can be extended as necessary. However I doubt many ColdFusion developers would have a need to extend it much beyond what it already provides. > On your point about having an "equals" method: This would be feasible > if > the CFC you were testing implemented and "equals" method which was able > to tell whether it was equal to another CFC by way of comparing > instance > variables/object state etc. i.e. it would require a custom > implementation of an equals() method for every CFC that you built This is exactly right, which is why CFUnit does not provide this type of equals method. It certainly wouldn't be difficult to add, however, if you were inclined to do that level of unit testing. Christian ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

