Thanks for your reply.
Can you please give me one simple program and how to do mockito on
that program.
==================================
See this is my java program
import java.io.*;
public class examplemock
{
public static void main(String args[])
{
System.out.println("Hello world!");
}
}
and i tried to test this program using mockitoand this is my testing
program
import static org.mockito.Matchers.anyObject;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
public class testmock
{
public static void main(String args[])
{
usage();
}
public static void usage()
{
List mockedList = mock(List.class);
mockedList.add("one");
mockedList.clear();
verify(mockedList).add("one");
verify(mockedList).clear();
}
}
I know my procedure is wrong but i couldnt get any other idea.help me
On Aug 5, 11:58 pm, szczepiq <
szcze...@gmail.com> wrote:
> Check out the documentation - there examples:
>
> List mock = Mockito.moc(List.class);
>
> when(mock.get(0)).thenReturn("foo");
>
> System.out.println(mock.get(0));
>
> taa daam! your first mock is up!
>
> Cheers,
> Szczepan Faber
>