Commit f56d5507 authored by Filippo Carone's avatar Filippo Carone

addMediaDescriptor refactored to addMedia

parent 709367d8
......@@ -57,10 +57,10 @@ public class MediaList
public void addMedia(String media)
{
MediaDescriptor descriptor = new MediaDescriptor(jvlc, media);
addMediaDescriptor(descriptor);
addMedia(descriptor);
}
public void addMediaDescriptor(MediaDescriptor descriptor)
public void addMedia(MediaDescriptor descriptor)
{
if (items.contains(descriptor.getMrl()))
{
......
......@@ -59,7 +59,7 @@ public class MediaListTest
Assert.assertEquals(1, mlist.itemsCount());
mlist.addMedia(mrl);
Assert.assertEquals(1, mlist.itemsCount());
mlist.addMediaDescriptor(new MediaDescriptor(jvlc, mrl));
mlist.addMedia(new MediaDescriptor(jvlc, mrl));
Assert.assertEquals(1, mlist.itemsCount());
mlist.addMedia("non-existing");
Assert.assertEquals(2, mlist.itemsCount());
......@@ -88,15 +88,15 @@ public class MediaListTest
mlist.removeMedia(0);
Assert.assertEquals(0, mlist.itemsCount());
mlist.addMediaDescriptor(new MediaDescriptor(jvlc, mrl));
mlist.addMedia(new MediaDescriptor(jvlc, mrl));
mlist.removeMedia(0);
Assert.assertEquals(0, mlist.itemsCount());
mlist.addMediaDescriptor(new MediaDescriptor(jvlc, mrl));
mlist.addMedia(new MediaDescriptor(jvlc, mrl));
mlist.removeMedia(mrl);
Assert.assertEquals(0, mlist.itemsCount());
mlist.addMediaDescriptor(new MediaDescriptor(jvlc, mrl));
mlist.addMedia(new MediaDescriptor(jvlc, mrl));
mlist.removeMedia(new MediaDescriptor(jvlc, mrl));
Assert.assertEquals(0, mlist.itemsCount());
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment