Esempio n. 1
0
 public void testFindOne() {
   MockMusicService service = new MockMusicService();
   Song song = service.findOne("Dark Horse");
   Assert.assertEquals("Dark Horse", song.getSongTitle());
   Assert.assertEquals("Katy Perry", song.getArtistName());
   Assert.assertEquals("Single", song.getAlbumTitle());
 }
Esempio n. 2
0
  public void testFindAll() {
    MockMusicService service = new MockMusicService();
    List<Song> songs = service.findAll();
    Assert.assertNotNull(songs);

    boolean testResultFound = false;
    for (Song song : songs) {
      if (song.getAlbumTitle().equalsIgnoreCase("Dark Horse")) {
        testResultFound = true;
      }
    }
    Assert.assertEquals(false, testResultFound);
  }