Results 1 to 1 of 1
Thread: Problem in mocking a class
- 10-05-2010, 08:01 AM #1Member
- Join Date
- Oct 2010
- Rep Power
Problem in mocking a class
Hi! I am a newbie in on TDD. I'm trying to understand how to perform test on a mock object (I'm using Easymock).
For example, i need to test a validate() method of my class InputFile: this should return true if one or more elements are presents in the List InputFile.documents.
I tried with:
geminiMockFile = control.createMock(InputFile1.class);
but this gives a nullpointerexception.
Why this doesn't works? Have I to create also a mock list of documents and fill its?
- By ea09530 in forum New To JavaReplies: 0Last Post: 04-04-2010, 10:06 AM
- By hotinlavacoolinjava in forum New To JavaReplies: 4Last Post: 09-22-2009, 10:23 AM
- By cenafu in forum AWT / SwingReplies: 8Last Post: 03-21-2009, 09:34 AM
- By alin_ms in forum New To JavaReplies: 3Last Post: 12-19-2008, 07:35 PM
- By Kat in forum New To JavaReplies: 3Last Post: 11-08-2007, 12:24 AM