Guest User

Untitled

a guest
Apr 8th, 2013
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. package org.openmrs.api;
  2.  
  3. import static junit.framework.Assert.assertEquals;
  4. import static junit.framework.Assert.assertTrue;
  5. import static org.junit.Assert.*;
  6. import junit.framework.Assert;
  7.  
  8. import org.junit.Test;
  9. import org.openmrs.Obs;
  10. import org.openmrs.api.context.Context;
  11. import org.openmrs.api.db.NoteDAO;
  12. import org.openmrs.notification.Note;
  13. import org.openmrs.notification.NoteService;
  14. import org.openmrs.test.Verifies;
  15.  
  16. public class NoteServiceTest {
  17.  
  18. //NoteDAO is an interface
  19. private Note note;
  20. private NoteDAO dao;
  21.  
  22. @Test
  23. @Verifies(value = "should void the Note and set the voidReason", method = "voidNote(Note,String)")
  24. public void voidNote_shouldVoidTheNoteAndSetTheVoidReason() throws Exception {
  25. NoteService noteService = Context.getNoteService();
  26.  
  27. Note note = noteService.getNote(1);
  28.  
  29. noteService.voidNote(note, "testing void function");
  30. assertTrue(note.getVoided());
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment