> If your view interface return a TextBox you can't test the presenter with
> JUnit, you will need to use GWTTestCase.

Sure you can:

import static org.easymock.classextension.EasyMock.*;
import com.google.gwt.user.client.ui.TextBox;

public class SomePresenterTestCase {

   private MyPresenter presenter;
   private MyView view;

   @Test
   public void testSomething() {
       TextBox mockBox = createMock(TextBox.class);
       MyView mockView = createMock(MyView.class);
       presenter = new MyPresenter(mockView);
       expect(mockView.getSomeTextBox()).andReturn(mockBox);
       replay(mockView);
       replay(mockBox);
       TextBox box = presenter.getDisplay().getSomeTextBox();
       verify(mockView);
   }
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to