The decision between same project/different project is a common issue
we face here at work. One of my co-workers only tests the public
methods so he wants to put his unit tests in a seperate project but I
like to test the protected methods as well. I like the "cleaner" look
to my unit tests when I am only testing the flow of 1 little method
instead of testing a public method that calls 6 or 7 smaller methods.
But, I agree with him in the fact that he never has to ship testing
code.
It should be noted that I don't have the easiest code to test since I
was a late adopter of unit testing on my current project. So, most of
my need to unit test the protected methods are because my public
methods are calling the database.
If you look at this web site: [
http://codebetter.com/blogs/karlseguin/
archive/2007/12/20/foundations-of-programming-part-5-unit-
testing.aspx] he talks about placing the tag [assembly:
InternalsVisibleTo("CodeBetter.Foundations.Tests")] in the Assembly.cs
file to allow your testing namespace access to your private/protected
methods. This only works on 2.0+.