I have a simple phone book class (this class is extracted because I inject a different phone book for testing) that has ~10 entries and I’m wondering. Do I create a test for each phone book entry or simply test to ensure a few phone numbers are successfully fetched based on the key?
The interface is quite simple.
public interface IPhoneBook
{
string Lookup(string key);
}
Have a test to test fetching an entry that should exist.
Have a test to test fetching an entry that should not exist.
That should be enough, if the data structure is as simple as you describe.
Ask yourself – what value would testing all entries give you over the above tests? If none, don’t do it.