Guice Problem with Tests

Posted by D3orn on Stack Overflow See other posts from Stack Overflow or by D3orn
Published on 2010-05-07T09:19:08Z Indexed on 2010/05/07 15:48 UTC
Read the original article Hit count: 136

Filed under:

Hey I wrote a LudoGame and now I like to test it with a little GuiceInjection^^ I have an Interface IDie for my die. Now for the game I only need an IDie instead of a realdie => in tests I simply give the LudoGame a MokeDie to set up the Numbers I like to roll. The IDie has only one method: roll() which returns a int. BUT the mokeDie now has another public method: sendNextNumber() (should be clear what this does^^) Now I like to @Inject a Die and if @UseMokeDie is before a Test I'll like to pass the MokeDie but I'm very new to Guice... Need some advices please! Thx for Answers

© Stack Overflow or respective owner

Related posts about guice