I am trying to test a private the following private methods
public class Test
{
private bool PVTMethod1(Guid[] Parameter1)
{
return true;
}
private bool PVTMethod2(RandomClass[] Parameter2)
{
return true;
}
}
public class RandomClass
{
public int Test { get; set; }
}
using the following test method
[TestClass]
public TestClass1
{
[TestMethod]
public void SomUnitTest()
{
Test _helper = new Test();
PrivateObject obj = new PrivateObject(_helper);
bool response1 = (bool)obj.Invoke("PVTMethod1", new Guid[0]);
bool response2 = (bool)obj.Invoke("PVTMethod2", new RandomClass[0]);
}
}
The second Invoke fails with an System.MissingMethodException.
It seems to not find the method when using a complex type as a array parameter