当NUnit的卷影复制打开时,如何将资源(任何内容)文件复制到输出文件夹?
当然,有一个选项可以将其关闭(默认情况下它是打开的)。但是,我希望能够在 NUnit GUI 副本启动时对 DLL 进行增量更改。
但是,我找不到有关此功能的太多文档(除了
在NUnit中启用Shadow copy,
我的 SUT (Dll) 调用可执行文件(也在输出文件夹中;通过引用)。现在,此可执行文件需要某些配置/修改器文件与可执行文件位于同一文件夹中。如何确保测试期间可执行文件可以访问我的参考修改器文件?
NUnit 卷影复制仅 SUT dll 还是所有链接/引用的 dll/execs ?我需要在测试设置中做什么才能正确复制 SUT 的所有支持文件?
我看到
- executingAssembly.Codebase 为我提供了原始输出文件夹
- executingAssembly.Location 为我提供了卷影副本文件夹。
我不确定我在这里是否清醒 - 让我知道是否需要更新
Of course there is an option to turn it off (by default it is on.) However I like to be able to make incremental changes to the DLL while a copy of NUnit GUI is up.
However I couldn't find much documentation for this feature (apart from the need)
So the problem is like this
With Shadow copy enabled in NUnit,
my SUT (Dll) invokes an executable (also in the output folder ; via references). Now this executable needs certain configuration/modifier files to be in the same folder as the executable. How do I ensure that my reference modifier files are reachable by the executable during the test ?
Does NUnit shadow copy just the SUT dll or all the linked/referenced dlls/execs ? What do I need to do in the test setup such that any supporting files for the SUT are copied correctly?
I see that
- executingAssembly.Codebase gives me the original output folder
- executingAssembly.Location gives me the shadow copy folder.
I'm not sure if I am being lucid here - let me know if I need to update
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
真正的问题通常是在测试期间找到它们的位置。
使用此代替
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)
:请参阅 确定程序集目录时 NUnit 出现问题
The real issue is usually finding where they are during the tests.
Use this instead of
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)
:See Trouble with NUnit when determining the assembly's directory