Ejemplo n.º 1
0
  public void testShowLatest() throws Exception {

    final TestResponse res = new TestResponse();
    final Latester b = new Latester();
    final Vector<Track> tracks = new Vector<Track>();
    final Vector<Artist> artists = new Vector<Artist>();
    final Vector<Album> albums = new Vector<Album>();
    final Artist artist = new Artist(1, "my artist");
    final Album album = new Album(artist, 1, "my album");
    final Track track = new Track(artist, null, 1, "my track", "", 1, null);

    tracks.add(track);
    artists.add(artist);
    albums.add(album);

    b.setResponse(res);
    b.showLatest(tracks, artists, albums);

    final String data = res.getOutput();

    assertTrue(data.contains(artist.getName()));
    assertTrue(data.contains(track.getName()));
  }