aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/src/com/android/tv/data/GenreItemTest.java
diff options
context:
space:
mode:
authorNick Chalko <nchalko@google.com>2017-10-03 10:16:37 -0700
committerNick Chalko <nchalko@google.com>2017-10-04 13:48:13 +0000
commit6ebde20b03db4c0d57f67acaac11832b610b966b (patch)
treed31e2adc1f9cce4f27ca07d30bee921032e33a3c /tests/unit/src/com/android/tv/data/GenreItemTest.java
parentee027a576ddebaf1ae739219be01b0240b15f80c (diff)
downloadTV-6ebde20b03db4c0d57f67acaac11832b610b966b.tar.gz
Sync to match Live Channels 1.15(ncis)oreo-mr1-dev
aka ub-tv-dev at a73a150bb7d0d1ce867ef980c6ac8411899d40ad Bug: 64021596 Change-Id: I7c544fd15e2c58784f8babc31877ad0dfeebb4c0 (cherry picked from commit 633eb826b8c97731dfc5ef12c7bf78a63734275d)
Diffstat (limited to 'tests/unit/src/com/android/tv/data/GenreItemTest.java')
-rw-r--r--tests/unit/src/com/android/tv/data/GenreItemTest.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/unit/src/com/android/tv/data/GenreItemTest.java b/tests/unit/src/com/android/tv/data/GenreItemTest.java
index fb48fd41..fdbcb599 100644
--- a/tests/unit/src/com/android/tv/data/GenreItemTest.java
+++ b/tests/unit/src/com/android/tv/data/GenreItemTest.java
@@ -16,23 +16,32 @@
package com.android.tv.data;
+import static android.support.test.InstrumentationRegistry.getTargetContext;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
import android.media.tv.TvContract.Programs.Genres;
import android.os.Build;
import android.support.test.filters.SmallTest;
-import android.test.AndroidTestCase;
+
+import org.junit.Test;
/**
* Tests for {@link Channel}.
*/
@SmallTest
-public class GenreItemTest extends AndroidTestCase {
+public class GenreItemTest {
private static final String INVALID_GENRE = "INVALID GENRE";
+ @Test
public void testGetLabels() {
// Checks if no exception is thrown.
- GenreItems.getLabels(getContext());
+ GenreItems.getLabels(getTargetContext());
}
+ @Test
public void testGetCanonicalGenre() {
int count = GenreItems.getGenreCount();
assertNull(GenreItems.getCanonicalGenre(GenreItems.ID_ALL_CHANNELS));
@@ -41,6 +50,7 @@ public class GenreItemTest extends AndroidTestCase {
}
}
+ @Test
public void testGetId_base() {
int count = GenreItems.getGenreCount();
assertEquals(GenreItems.ID_ALL_CHANNELS, GenreItems.getId(null));
@@ -58,6 +68,7 @@ public class GenreItemTest extends AndroidTestCase {
assertInRange(GenreItems.getId(Genres.GAMING), 1, count - 1);
}
+ @Test
public void testGetId_lmp_mr1() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP_MR1) {
assertEquals(GenreItems.ID_ALL_CHANNELS, GenreItems.getId(Genres.ARTS));