On Thursday, August 21, 2014 2:42:04 PM UTC+2, scl wrote:
>
>  If you pass dependencies in you constructor which are not required for 
> the test then your class has most likely too many responsibilities.
> If all your dependencies are required for the test you have to adapt the 
> test any ways and should not worry about the compiler errors but embrace 
> them since they help you find all the test cases which need update.
>

+1

Wrt the visibility of the constructors, because it's a generally accepted 
practice to put tests in the same package as the class under test, using a 
package-private constructor just works (you could annotate it with some 
@VisibleForTesting annotation if you still find that "too visible" and fear 
that some developer would use the constructor directly; with such 
annotation, or similar comment in the javadoc, you can later blame them for 
not following the rule ;-) )

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-guice/762ada39-ba7f-4eb7-8b36-6fac5104b46a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to