This problem doesn’t occur in all projects, hence it makes it even more frustrating.
If I click on a Private method to create a unit test, it would generate a TestProject assembly and create a predefined class in there. It would also create a Accessor for that class.
[TestMethod()]
[DeploymentItem("xxx.Client.dll")]
public void PopulateIncomeCostsDataSetTest()
{
CashFlowOperations_Accessor target = new CashFlowOperations_Accessor(); // TODO: Initialize to an appropriate value
CashflowModel cashflowModel = null; // TODO: Initialize to an appropriate value
CashflowDataSet ds = null; // TODO: Initialize to an appropriate value
target.PopulateIncomeCostsDataSet(cashflowModel, ds);
Assert.Inconclusive("A method that does not return a value cannot be verified.");
}
As long as I create this unit test for private methods in a library assembly (dll) its all fine, but if I create it for a Console application where [DeploymentItem("xxx.exe")] is an executable, my Accessor stays in red color and I cant access the internal private methods of that accessor.
This seemed to be a bug in Visual Studio. This can happen in VS 2088 and even VS 2010. The SP1 for VS 2010 solved this problem for me. Hope this helps other people.