I have C++ Managed project. And I'd like to test it with C# Nunit class library. I defined C++ class as
internal ref class SomeClass{};
And how can I make it visible to C# class library?
Yes, add the following to AssemblyInfo.cpp:
[assembly: InternalsVisibleTo("C#UnitTestClassLibraryName")]
By the way, InternalsVisibleTo works on the assembly level, so either the entire assembly is visible to the class specified, or none of it is.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With