How does one go about unit testing static void methods? I have a few more questions:
- Is it necessary to unit test database queries like insert, select and update queries ? If so, how does one test them ?
- Is unit testing of every method required ? If not, are there any rules I should keep in mind when deciding what methods should be tested?
- How would I unit test a method that sends files from one system to another? The input to this method is just the IP address of the target system.
- What is the best way of testing private methods that I have written? I have changed the scope to public and tested them. Is this a bad practice?
- Must every unit test method have an assert statement? Is it possible to have a unit test without an assert statement? If so, how do I test it?
I am doing the unit testing in C# and I am using MSTest for testing.
Aucun commentaire:
Enregistrer un commentaire