Refactor unit test
This commit is contained in:
parent
1d00c641b0
commit
9a5ece76c6
|
@ -9,16 +9,16 @@ import org.junit.Test;
|
|||
|
||||
public class TMDbTVClientTest {
|
||||
|
||||
TMDbTVClient tmdb = new TMDbTVClient(new TMDbClient("66308fb6e3fd850dde4c7d21df2e8306"));
|
||||
static TMDbTVClient db = new TMDbTVClient(TMDbClientTest.db);
|
||||
|
||||
SearchResult buffy = new SearchResult(95, "Buffy the Vampire Slayer");
|
||||
SearchResult wonderfalls = new SearchResult(1982, "Wonderfalls");
|
||||
SearchResult firefly = new SearchResult(1437, "Firefly");
|
||||
static SearchResult buffy = new SearchResult(95, "Buffy the Vampire Slayer");
|
||||
static SearchResult wonderfalls = new SearchResult(1982, "Wonderfalls");
|
||||
static SearchResult firefly = new SearchResult(1437, "Firefly");
|
||||
|
||||
@Test
|
||||
public void search() throws Exception {
|
||||
// test default language and query escaping (blanks)
|
||||
List<SearchResult> results = tmdb.search("babylon 5", Locale.ENGLISH);
|
||||
List<SearchResult> results = db.search("babylon 5", Locale.ENGLISH);
|
||||
|
||||
assertEquals(1, results.size());
|
||||
|
||||
|
@ -28,7 +28,7 @@ public class TMDbTVClientTest {
|
|||
|
||||
@Test
|
||||
public void getEpisodeListAll() throws Exception {
|
||||
List<Episode> list = tmdb.getEpisodeList(buffy, SortOrder.Airdate, Locale.ENGLISH);
|
||||
List<Episode> list = db.getEpisodeList(buffy, SortOrder.Airdate, Locale.ENGLISH);
|
||||
|
||||
assertTrue(list.size() >= 144);
|
||||
|
||||
|
@ -55,7 +55,7 @@ public class TMDbTVClientTest {
|
|||
|
||||
@Test
|
||||
public void getEpisodeListSingleSeason() throws Exception {
|
||||
List<Episode> list = tmdb.getEpisodeList(wonderfalls, SortOrder.Airdate, Locale.ENGLISH);
|
||||
List<Episode> list = db.getEpisodeList(wonderfalls, SortOrder.Airdate, Locale.ENGLISH);
|
||||
|
||||
Episode first = list.get(0);
|
||||
assertEquals("Wonderfalls", first.getSeriesName());
|
||||
|
|
Loading…
Reference in New Issue