Making functions accessible from other classes in same project but not in another Project

Solution 1:

To control class accessibility you have a keyword you add before its declaration:

public class Category_File_Manager 

If you do not add the public it defaults to internal and that would result in class being accessible from project/library that declares it and not accessible from any other, that includes tests.

You can circumvent this using InternalsVisibleTo assembly level attribute for test library benefit.

[assembly: InternalsVisibleToAttribute("Category_Helper_Project_Tests")]

This has a bit of a code smell that your library becomes somewhat aware of the test library but this is a case of having a cake and eating it. It is a good idea to remove such access from production code so I would wrap this in compilation if so it is not added on release build.

#if DEBUG
[assembly: InternalsVisibleToAttribute("Category_Helper_Project_Tests")]
#endif