-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/test/java/de/mediathekview/mlib/daten/ListeFilmeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package de.mediathekview.mlib.daten; | ||
|
||
import de.mediathekview.mlib.Const; | ||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class ListeFilmeTest { | ||
|
||
@Test | ||
public void testUpdateListeIndex() { | ||
ListeFilme list = new ListeFilme(); | ||
list.add(createTestFilm(Const.ZDF, "ZDFinfo Doku", "Ermittler! Fatale Verbindungen (S2025/E05)", "https://nrodlzdf-a.akamaihd.net/none/zdf/25/03/250303_ermittler_fatale_verbindungen_inf/1/250303_ermittler_fatale_verbindungen_inf_3360k_p36v17.mp4")); | ||
ListeFilme listOld = new ListeFilme(); | ||
listOld.add(createTestFilm(Const.ZDF, "ZDFinfo Doku", "Ermittler! Fatale Verbindungen (S2025/E05)", "https://nrodlzdf-a.akamaihd.net/none/zdf/25/03/250303_ermittler_fatale_verbindungen_inf/1/250303_ermittler_fatale_verbindungen_inf_3360k_p36v17.mp4")); | ||
listOld.add(createTestFilm(Const.ZDF, "ZDFinfo Doku", "identische Url nicht hinzugefügt", "https://nrodlzdf-a.akamaihd.net/none/zdf/25/03/250303_ermittler_fatale_verbindungen_inf/1/250303_ermittler_fatale_verbindungen_inf_3360k_p36v17.mp4")); | ||
listOld.add(createTestFilm(Const.ZDF, "ZDFinfo Doku", "gleiche Url mit anderen Host nicht hinzugefügt", "https://rodlzdf-a.akamaihd.net/none/zdf/25/03/250303_ermittler_fatale_verbindungen_inf/1/250303_ermittler_fatale_verbindungen_inf_3360k_p36v17.mp4")); | ||
listOld.add(createTestFilm(Const.ZDF, "ZDFinfo Doku", "andere Url hinzugefügt", "https://nrodlzdf-a.akamaihd.net/none/zdf/25/02/250303_ermittler_fatale_verbindungen_inf/1/250303_ermittler_fatale_verbindungen_inf_3360k_p36v17.mp4")); | ||
|
||
list.updateListe(listOld, true, false); | ||
assertEquals(2, list.size()); | ||
} | ||
@Test | ||
public void testUpdateListeUrl() { | ||
ListeFilme list = new ListeFilme(); | ||
list.add(createTestFilm(Const.ZDF, "ZDFinfo Doku", "Ermittler! Fatale Verbindungen (S2025/E05)", "https://nrodlzdf-a.akamaihd.net/none/zdf/25/03/250303_ermittler_fatale_verbindungen_inf/1/250303_ermittler_fatale_verbindungen_inf_3360k_p36v17.mp4")); | ||
ListeFilme listOld = new ListeFilme(); | ||
listOld.add(createTestFilm(Const.ZDF, "ZDFinfo Doku", "Ermittler! Fatale Verbindungen (S2025/E05)", "https://nrodlzdf-a.akamaihd.net/none/zdf/25/03/250303_ermittler_fatale_verbindungen_inf/1/250303_ermittler_fatale_verbindungen_inf_3360k_p36v17.mp4")); | ||
listOld.add(createTestFilm(Const.ZDF, "ZDFinfo Doku", "Ermittler! Fatale Verbindungen (S2025/E05)", "https://nrodlzdf-a.akamaihd.net/none/zdf/25/03/250303_ermittler_fatale_verbindungen_inf/1/250303_ermittler_fatale_verbindungen_inf_3360k_p36v17.mp4")); | ||
listOld.add(createTestFilm(Const.ZDF, "ZDFinfo Doku", "Ermittler! Fatale Verbindungen (S2025/E05)", "https://nrodlzdf-a.akamaihd.net/none/zdf/25/03/250303_ermittler_fatale_verbindungen_inf/1/250303_ermittler_fatale_verbindungen_inf_3360k_p36v17.mp4")); | ||
listOld.add(createTestFilm(Const.ZDF, "ZDFinfo Doku", "andere Episode", "https://nrodlzdf-a.akamaihd.net/none/zdf/25/02/250303_ermittler_fatale_verbindungen_inf/1/250303_ermittler_fatale_verbindungen_inf_3360k_p36v17.mp4")); | ||
|
||
list.updateListe(listOld, false, false); | ||
assertEquals(2, list.size()); | ||
} | ||
|
||
private static DatenFilm createTestFilm(String sender, String topic, String title, | ||
String filmUrl) { | ||
DatenFilm film = new DatenFilm(sender, topic, "url", title, filmUrl, "", "", "", 12, | ||
""); | ||
film.arr[DatenFilm.FILM_GROESSE] = "10"; | ||
|
||
return film; | ||
} | ||
|
||
} |