测试多个版本的Nuget的最简单方法是什么?
我有两个C#项目。项目A是Nuget软件包。项目B是网络服务。项目A调用Web服务。
我们希望B(Web Serice)与A -IE的旧版本保持向后兼容
。这很容易为A的单个版本进行测试 - 只需在测试项目中安装Nuget软件包,然后针对Web服务的实例运行一些测试即可。
对于多个版本的Nuget,最方便的方法是什么?我无法轻松地引用多个版本的nuget,并在运行时切换它们。当然,我可以进行多个测试项目并在每个测试项目中引用不同的Nuget版本,但是我是否必须在多个项目中复制测试?那将是非常不便的。
有一个不错的方法吗?我可以使用预处理器指令做一些聪明的事情,并通过同一源代码构建不同的DLL?还是什么?
提前致谢!
I have two C# projects. Project A is a NuGet package. Project B is a web service. Project A calls the web service.
We want B (the web serice) to remain backward-compatible with old versions of A - i.e., old versions of A can still call the newest version of B.
I want to write integration tests to verify this. This is easy enough to test for a single version of A - just install the NuGet package in a test project and run some tests against an instance of the web service.
What is the most convenient way to do this for multiple versions of the NuGet? I cannot easily reference multiple versions of a NuGet and switch between them at runtime. Of course I can make multiple test projects and reference a different NuGet version in each test project, but do I then have to copy the tests themselves across multiple projects? That would be very inconvenient.
Is there a nice way to do this? Can I maybe do something clever with preprocessor directives and build different DLLs from the same source code? Or something?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论