在Midas / DataSnap项目中进行DUnit测试 [英] DUnit Testing in a Midas/DataSnap project
问题描述
如何在Delphi 2006中的一个Midas / DataSnap项目中设置DUnit测试
How does one setup DUnit Testing in a Midas/DataSnap project in Delphi 2006
编辑
一个将Dunit测试设置为TRemoteDataModule
Delphi 2006中的项目向导不能与TRemoteDataModule一起使用
How does one set up a Dunit Test into a TRemoteDataModule The project wizard in Delphi 2006 does not work with TRemoteDataModule
推荐答案
这个问题并不完全正确。单元测试在单独的项目中执行,而不是在您的DataSnap服务器中执行。通常,连接到数据库的测试是集成测试,而不是单元测试。这是什么,正是你想测试?如果是TREMoteDataModule中的实用方法,那么您应该将它们作为类方法提取到一个单独的类中,并在那里进行测试。您不需要实例化应用程序服务器来执行单元测试。
The question doesn't entirely make sense. Unit tests are performed in a separate project, not within your DataSnap server. Generally, tests which connect to a database are integration tests rather than unit tests. What is it, exactly that you want to test? If it's utility methods within, say, a TRemoteDataModule, you should extract those out into a separate class as class methods, and test them there. You should not have to instantiate an application server to perform unit tests.
这篇关于在Midas / DataSnap项目中进行DUnit测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!