My build server uses MSBuild to build my application. Our unit tests require access to some private members for testing, so we use the built in private accessors. Visual Studio has no problem with it, but when we push our code to the build server we get the error:
MyTest.cs (96,13): errorCS0246: The type or namespace name 'My_Accessor' could not be found (are you missing a using directive or an assembly reference?)
Why is it that MSBuild ignores the private accessors and how can I fix it?
We use NUnit for our testing framework and CruiseControl.Net for our continuous integration server.
EDIT: As per the comment, here is some test code for the base class for a repository pattern class.
MockRepository mocks = new MockRepository();
IDataContextWrapper wrapper = mocks.DynamicMock<IDataContextWrapper>();
Repository_Accessor target = new Repository_Accessor(wrapper);
Assert.AreEqual(wrapper, target._DataContext);
This code simply verifies that the member variables _DataContext is set to the mocked wrapper. It fails when building with MSBuild on my build server.