I am wondering how to use NUnit correctly. First, I created a separate test project that uses my main project as reference. But in that case, I am not able to test private m
A common pattern for writing unit tests is to only test public methods.
If you find that you have many private methods that you want to test, normally this is a sign that you should refactor your code.
It would be wrong to make these methods public on the class where they currently live. That would break the contract that you want that class to have.
It may be correct to move them to a helper class and make them public there. This class may not be exposed by your API.
This way test code is never mixed with your public code.
A similar problem is testing private classes ie. classes you do not export from your assembly. In this case you can explicitly make your test code assembly a friend of the production code assembly using the attribute InternalsVisibleTo.