views:

19

answers:

1

This problem doesnt 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 woudl 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 Accesor stays in red color and I cant access the internal private methods of that accessor.

Has anyone experienced this problem before? Many Thanks,

A: 

I don't know if this helps (I haven't been able to reproduce your error) but in Local.testsettings there is an option to enable deployment.

  • Open Local.testsettings from Solution Items
  • Select "Deployment" item in listbox
  • Check "Enable deployment"

This must be done before you can unit test in applications instead of libraries

slamidtfyn
Thanks for your response. I just double checked it and it is already checked. I have no idea why that is like this. :(
Kave