在 MappingIntegrationTests 中测试多个数据库映射
在 as#arparch 项目中测试多个数据库的最佳方法是什么?
MappingIntegrationTests 中的当前 SetUp() 代码尝试针对第一个数据库测试每个程序集。
string[] mappingAssemblies = RepositoryTestsHelper.GetMappingAssemblies();
configuration = NHibernateSession.Init(new SimpleSessionStorage(), mappingAssemblies,
new AutoPersistenceModelGenerator().Generate(),
"../../../../app/Humanities.IBusiness.Web/NHibernate.config");
有没有人设法根据适当的数据库模式正确测试每个映射?
What's the best approach for testing multiple db's in a s#arparch project?
The current SetUp() code in MappingIntegrationTests tries to test each assembly against the first database.
string[] mappingAssemblies = RepositoryTestsHelper.GetMappingAssemblies();
configuration = NHibernateSession.Init(new SimpleSessionStorage(), mappingAssemblies,
new AutoPersistenceModelGenerator().Generate(),
"../../../../app/Humanities.IBusiness.Web/NHibernate.config");
Has anyone managed to correctly test each mapping against the appropriate database schema?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
嘿亚历克,谢谢你的回复。我已经破解了一些解决方案 - 它并不漂亮,但它确实在多个数据库之间进行了冒烟测试,
在设置中我添加了以下内容:
然后在 CanConfirmDatabaseMatchesMappings 中
不确定它是否是完整的答案,但总比没有好:)
任何想法?
Hey Alec, thanks for the reply. I've hacked a bit of a solution - it aint pretty but it does smoke test dodgy mappings across multiple db's
In the set up I add the following:
Then in the CanConfirmDatabaseMatchesMappings
Not sure if it's a full answer but better than nothing :)
Any thoughts?
艾尔,
老实说,我不知道用户使用多个数据库的程度。我相信这是一些非常直言不讳的人在项目生命周期开始时游说的事情。这是我要向社区询问的问题,看来是时候提出这个问题了。
您可能需要做的是将设置代码移至单独的方法中。虽然我并不热衷于破坏 DRY 原则,但在这种情况下似乎这是必需的。
亚历克
Al,
to be honest I do not know the extent that the users are using Multiple Databases. This is something I believe a few very vocal people lobbied for in the beginning of the projects lifecycle. This is something I was going to ask the community about, looks like the time has come for the question to be asked.
What you might need to do is move the set-up code into individual methods. While I am not crazy with breaking the DRY principal, it would seem in this case it is required.
Alec