Hi Unity members,
For unit testing I am trying to use InternalsVisibleTo(“assemblyname”) in Unity 3d without any success.
Has anyone ever used it in Unity ?
Here is the problem.
[assembly: InternalsVisibleTo("Test")]
namespace Dev
{
public class Example
{
internal bool Function(){ //do stuff }
}
}
namespace Test
{
public class TestExample
{
Example example = new Example();
bool value = example.Function();//Error Cannot access "Function" due to its
//protection level
}
}
When I open this project in .Net 2008, .Net compiler does not give ANY error.
Note : In the documentation for InternalVisibleTo, its written that this is a new class for .Net 2.
Thanks for reading !!