Unit-testing Delphi data modules
问题 If all the business logic is present in a datamodule (TSQLDataSets and TDataSetProviders) how would you refactor the code to make the application more appropiate for unit testing? 回答1: After the last question about this, I wrote a blog post about how to do it. 回答2: Some basic tips: Your DataModules should never have any references to forms or any other UI components Put the TDataSources on forms and not in your DataModules. Make sure there isn't any prompts for confirmation and operations