Jeff, How about this: rather than calling the built-in CreateUUID(), call your own function that will return either a hardcoded value or a real UUID, depending on a test mode flag.
if (Request.testFlag) return "fake UUID"; else return CreateUUID(); For maximum verisimilitude you could return test UUIDs from out of a preset list - not sure how sensitive your testing needs to be. Jaime Metcher > -----Original Message----- > From: Jeff Chastain [mailto:[EMAIL PROTECTED] > Sent: Friday, 27 July 2007 3:18 AM > To: CF-Talk > Subject: Unit Testing an XML Parsing Function > > > I have a component whose init method takes the path to an xml file and > parses the contents of that xml file into an internal data > structure. Now I > am trying to write the unit test for this function and I am getting stuck. > My original attempt was to pass in a test xml file and the manually create > the matching data structure and compare the two. The problem is, > during the > parsing of this xml file, the component creates and inserts several UUID > values into the internal data structure. Obviously, I cannot magically > generate the same UUID value when I manually create the matching data > structure to compare against. > > > > So, does anybody have any suggestions on testing this type of > functionality? > > > > Thanks. > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Check out the new features and enhancements in the latest product release - download the "What's New PDF" now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284665 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4