I am doing TDD with Greenfoot and trying to mock the Greenfoot class. I'm using the EasyMock mocking utility with JUnitTest. Below is my code:
When I run the code it says that there is a NullPointerException in Greenfoot.ask(), is there something I am missing about properly mocking the Greenfoot class?
@Test public void testPlayerSelection(){ Greenfoot gfoot = EasyMock.mock(Greenfoot.class); EasyMock.expect(gfoot.ask("How many players")).andReturn("3"); EasyMock.replay(gfoot); }