This repository has been archived by the owner on Feb 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
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
6 changed files
with
310 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
...src/test/java/com/mgaetan89/showsrage/adapter/ComingEpisodesAdapter_GetItemCountTest.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,52 @@ | ||
package com.mgaetan89.showsrage.adapter; | ||
|
||
import com.mgaetan89.showsrage.model.ComingEpisode; | ||
|
||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@RunWith(Parameterized.class) | ||
public class ComingEpisodesAdapter_GetItemCountTest { | ||
@Parameterized.Parameter(0) | ||
public List<ComingEpisode> comingEpisodes; | ||
|
||
@Parameterized.Parameter(1) | ||
public int itemCount; | ||
|
||
private ComingEpisodesAdapter adapter; | ||
|
||
@Before | ||
public void before() { | ||
this.adapter = new ComingEpisodesAdapter(this.comingEpisodes); | ||
} | ||
|
||
@Test | ||
public void getItemCount() { | ||
assertThat(this.adapter.getItemCount()).isEqualTo(this.itemCount); | ||
} | ||
|
||
@After | ||
public void after() { | ||
this.adapter = null; | ||
} | ||
|
||
@Parameterized.Parameters | ||
public static Collection<Object[]> data() { | ||
return Arrays.asList(new Object[][]{ | ||
{null, 0}, | ||
{Collections.emptyList(), 0}, | ||
{Collections.singletonList(new ComingEpisode()), 1}, | ||
{Arrays.asList(new ComingEpisode(), new ComingEpisode(), new ComingEpisode()), 3}, | ||
}); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
app/src/test/java/com/mgaetan89/showsrage/adapter/EpisodesAdapter_GetItemCountTest.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,52 @@ | ||
package com.mgaetan89.showsrage.adapter; | ||
|
||
import com.mgaetan89.showsrage.model.Episode; | ||
|
||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@RunWith(Parameterized.class) | ||
public class EpisodesAdapter_GetItemCountTest { | ||
@Parameterized.Parameter(0) | ||
public List<Episode> episodes; | ||
|
||
@Parameterized.Parameter(1) | ||
public int itemCount; | ||
|
||
private EpisodesAdapter adapter; | ||
|
||
@Before | ||
public void before() { | ||
this.adapter = new EpisodesAdapter(this.episodes, 1); | ||
} | ||
|
||
@Test | ||
public void getItemCount() { | ||
assertThat(this.adapter.getItemCount()).isEqualTo(this.itemCount); | ||
} | ||
|
||
@After | ||
public void after() { | ||
this.adapter = null; | ||
} | ||
|
||
@Parameterized.Parameters | ||
public static Collection<Object[]> data() { | ||
return Arrays.asList(new Object[][]{ | ||
{null, 0}, | ||
{Collections.emptyList(), 0}, | ||
{Collections.singletonList(new Episode()), 1}, | ||
{Arrays.asList(new Episode(), new Episode(), new Episode()), 3}, | ||
}); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
app/src/test/java/com/mgaetan89/showsrage/adapter/HistoriesAdapter_GetItemCountTest.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,52 @@ | ||
package com.mgaetan89.showsrage.adapter; | ||
|
||
import com.mgaetan89.showsrage.model.History; | ||
|
||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@RunWith(Parameterized.class) | ||
public class HistoriesAdapter_GetItemCountTest { | ||
@Parameterized.Parameter(0) | ||
public List<History> histories; | ||
|
||
@Parameterized.Parameter(1) | ||
public int itemCount; | ||
|
||
private HistoriesAdapter adapter; | ||
|
||
@Before | ||
public void before() { | ||
this.adapter = new HistoriesAdapter(this.histories); | ||
} | ||
|
||
@Test | ||
public void getItemCount() { | ||
assertThat(this.adapter.getItemCount()).isEqualTo(this.itemCount); | ||
} | ||
|
||
@After | ||
public void after() { | ||
this.adapter = null; | ||
} | ||
|
||
@Parameterized.Parameters | ||
public static Collection<Object[]> data() { | ||
return Arrays.asList(new Object[][]{ | ||
{null, 0}, | ||
{Collections.emptyList(), 0}, | ||
{Collections.singletonList(new History()), 1}, | ||
{Arrays.asList(new History(), new History(), new History()), 3}, | ||
}); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
app/src/test/java/com/mgaetan89/showsrage/adapter/LogsAdapter_GetItemCountTest.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,50 @@ | ||
package com.mgaetan89.showsrage.adapter; | ||
|
||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@RunWith(Parameterized.class) | ||
public class LogsAdapter_GetItemCountTest { | ||
@Parameterized.Parameter(1) | ||
public int itemCount; | ||
|
||
@Parameterized.Parameter(0) | ||
public List<String> logs; | ||
|
||
private LogsAdapter adapter; | ||
|
||
@Before | ||
public void before() { | ||
this.adapter = new LogsAdapter(this.logs); | ||
} | ||
|
||
@Test | ||
public void getItemCount() { | ||
assertThat(this.adapter.getItemCount()).isEqualTo(this.itemCount); | ||
} | ||
|
||
@After | ||
public void after() { | ||
this.adapter = null; | ||
} | ||
|
||
@Parameterized.Parameters | ||
public static Collection<Object[]> data() { | ||
return Arrays.asList(new Object[][]{ | ||
{null, 0}, | ||
{Collections.emptyList(), 0}, | ||
{Collections.singletonList(""), 1}, | ||
{Arrays.asList("", "", ""), 3}, | ||
}); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
app/src/test/java/com/mgaetan89/showsrage/adapter/SearchResultsAdapter_GetItemCountTest.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,52 @@ | ||
package com.mgaetan89.showsrage.adapter; | ||
|
||
import com.mgaetan89.showsrage.model.SearchResultItem; | ||
|
||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@RunWith(Parameterized.class) | ||
public class SearchResultsAdapter_GetItemCountTest { | ||
@Parameterized.Parameter(1) | ||
public int itemCount; | ||
|
||
@Parameterized.Parameter(0) | ||
public List<SearchResultItem> searchResultItems; | ||
|
||
private SearchResultsAdapter adapter; | ||
|
||
@Before | ||
public void before() { | ||
this.adapter = new SearchResultsAdapter(this.searchResultItems); | ||
} | ||
|
||
@Test | ||
public void getItemCount() { | ||
assertThat(this.adapter.getItemCount()).isEqualTo(this.itemCount); | ||
} | ||
|
||
@After | ||
public void after() { | ||
this.adapter = null; | ||
} | ||
|
||
@Parameterized.Parameters | ||
public static Collection<Object[]> data() { | ||
return Arrays.asList(new Object[][]{ | ||
{null, 0}, | ||
{Collections.emptyList(), 0}, | ||
{Collections.singletonList(new SearchResultItem()), 1}, | ||
{Arrays.asList(new SearchResultItem(), new SearchResultItem(), new SearchResultItem()), 3}, | ||
}); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
app/src/test/java/com/mgaetan89/showsrage/adapter/ShowsAdapter_GetItemCountTest.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,52 @@ | ||
package com.mgaetan89.showsrage.adapter; | ||
|
||
import com.mgaetan89.showsrage.model.Show; | ||
|
||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@RunWith(Parameterized.class) | ||
public class ShowsAdapter_GetItemCountTest { | ||
@Parameterized.Parameter(1) | ||
public int itemCount; | ||
|
||
@Parameterized.Parameter(0) | ||
public List<Show> shows; | ||
|
||
private ShowsAdapter adapter; | ||
|
||
@Before | ||
public void before() { | ||
this.adapter = new ShowsAdapter(this.shows); | ||
} | ||
|
||
@Test | ||
public void getItemCount() { | ||
assertThat(this.adapter.getItemCount()).isEqualTo(this.itemCount); | ||
} | ||
|
||
@After | ||
public void after() { | ||
this.adapter = null; | ||
} | ||
|
||
@Parameterized.Parameters | ||
public static Collection<Object[]> data() { | ||
return Arrays.asList(new Object[][]{ | ||
{null, 0}, | ||
{Collections.emptyList(), 0}, | ||
{Collections.singletonList(new Show()), 1}, | ||
{Arrays.asList(new Show(), new Show(), new Show()), 3}, | ||
}); | ||
} | ||
} |