单元测试c#项目,引用c ++ managed dll,c ++ dll加载c ++链接库

问题描述:

我正在编写一个引用c ++ dll的c#项目的单元测试。这个c ++ dll是c ++链接库的托管包装器。因此,当我运行单元测试时,我遇到下面的异常,

I am writing unit tests for a c# project that refers c++ dll. This c++ dll is a managed wrapper for c++ linked library. So when I run a unit test I run into below exception,

我使用的是VS2015,.net 4.5。

I am using VS2015, .net 4.5.

如何解决此问题?我可以模拟整个lib,但这限制了单元测试的范围。

How do resolve this? I can mock the entire lib but that limits the scope on unit test.

谢谢

~Vaishali

~Vaishali

您好VaishaliDPatil,

Hi VaishaliDPatil,

感谢您发布此处。

根据您的问题与单元测试更相关,我将把它移到
Visual Studio单元测试
 论坛以获得合适的支持。

According to your question is more related to Unit Testing, I will move it to Visual Studio Unit Testing forum for suitable support.

CLR论坛讨论并提出有关.NET Framework基类(BCL)的问题,例如集合,I / O,Regigistry,Globalization,Reflection。还讨论了构建或扩展.NET Framework的所有其他Microsoft
库,包括Managed Extensibility Framework(MEF),Charting Controls,CardSpace,Windows Identity Foundation(WIF),Point of Sale(POS),Transactions 。

最好的问候,

Wendy