I have a controller class and a service class. Controller has endpoints and service layer has functions performing something specific (inserting, loading a file and counting lines, updating, etc).
Now what I want to know is, should I unit test an endpoint(controllers) as a whole or individual functions present in the service layer? I've really been confused. Please help.