I looked at google and the stack over the stream and read all the posts on how to get InternalsVisibleTo to work.
But it does not work for me.
Please do not vote for this question because I tried my best to see and implement the answers on the forums.
My code is as follows:
* Inside TestInternal project *
namespace TestInteral
{
[TestClass]
public class MyProviderTest
{
[TestMethod]
public void TestBar()
{
bool retval = false;
retval = new MyProviderClass().Bar();
Assert.AreEqual(true,retval);
}
}
}
* Provider’s internal project *
[assembly: InternalsVisibleTo("TestInternal")]
namespace Provider
{
public class MyProviderClass
{
internal bool Bar()
{
return true;
}
private void UseBar()
{
bool retval = Bar();
}
}
}
The following error appears in my test class.
Error 1 'Provider.MyProviderClass' does not contain a definition for "Bar", and the extension method "Bar" cannot be found that takes the first argument of the type "Provider.MyProviderClass" (do you miss the using directive or the assembly reference?)
, , InternalsVisibleTo, MyProviderClass.