Revision: 7c4ad7574d42
Author:   eatnumber1 <[email protected]>
Date:     Fri Apr 11 02:13:12 2014 UTC
Log:      Edited wiki page BoundFields through web user interface.
http://code.google.com/p/google-guice/source/detail?r=7c4ad7574d42&repo=wiki

Modified:
 /BoundFields.wiki

=======================================
--- /BoundFields.wiki   Fri Apr 11 02:12:01 2014 UTC
+++ /BoundFields.wiki   Fri Apr 11 02:13:12 2014 UTC
@@ -2,7 +2,7 @@

 = !BoundFields =

-Test code which uses Guice frequently follows the pattern whereby you create several fields in your test class and bind those fields to their types using a custom Module. BoundFieldModule can help simplify this pattern by automatically binding fields annotated with @Bind. +Test code which uses Guice frequently follows the pattern whereby you create several fields in your test class and bind those fields to their types using a custom Module. {{{BoundFieldModule}}} can help simplify this pattern by automatically binding fields annotated with {{{@Bind}}}.

 == Binding Fields Manually ==
Frequently in order to test classes which are injected, you need to inject mocks or dummy values for the tested class's dependencies. In order to do this, a common pattern is the following:
@@ -34,7 +34,7 @@
 }}}
This class creates a field for the tested class's dependencies, places in that field a mock and binds the field into Guice with a custom Module.

-== Binding Fields Using BoundFieldModule ==
+== Binding Fields Using {{{BoundFieldModule}}} ==
{{{BoundFieldModule}}} scans a given object for fields annotated with @Bind and binds those fields automatically. Using this, we can simplify our {{{TestFoo}}} class to:
 {{{
 public class TestFoo {

--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" 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-dev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to