Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. // assume there is a class SampleFile
  2. @Mock
  3. Class SampeFile.class; //SampleFile.java?
  4. @Test
  5. public void testparseClass() {
  6. // testing Parser class
  7. Parser parser = new Parser(SampleFile.class);
  8.  
  9. // call a method
  10. private Clazz result = parser.parseClass();
  11.  
  12. // test return type
  13. assertTrue(result);
  14.  
  15. // test that parseClass method on mock object was called
  16. Mockito.verify(Example.class).parseClass();
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement