I have looked into google and stack over flow and read all the posts regarding how to get InternalsVisibleTo to work.
But its not working for me.
Please do not down vote this question because I have tried my best to look 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);
}
}
}
* Inside Provider Project *
[assembly: InternalsVisibleTo("TestInternal")]
namespace Provider
{
public class MyProviderClass
{
internal bool Bar()
{
return true;
}
private void UseBar()
{
bool retval = Bar();
}
}
}
I am getting the following error in my test class.
Error 1 'Provider.MyProviderClass' does not contain a definition for 'Bar' and no extension method 'Bar' accepting a first argument of type 'Provider.MyProviderClass' could be found (are you missing a using directive or an assembly reference?)
Please let me know how I could use the InternalsVisibleTo correctly so I could correctly test the Internal method in the MyProviderClass.
Thanks