diff options
author | Nick Chalko <nchalko@google.com> | 2017-10-03 10:16:37 -0700 |
---|---|---|
committer | Nick Chalko <nchalko@google.com> | 2017-10-03 14:23:55 -0700 |
commit | 633eb826b8c97731dfc5ef12c7bf78a63734275d (patch) | |
tree | d31e2adc1f9cce4f27ca07d30bee921032e33a3c /tests/unit/src/com/android/tv/data/ProgramTest.java | |
parent | e420c9665d2f52edf92b38c884b5b8f332f6128b (diff) | |
download | TV-633eb826b8c97731dfc5ef12c7bf78a63734275d.tar.gz |
Sync to match Live Channels 1.15(ncis)
aka ub-tv-dev at a73a150bb7d0d1ce867ef980c6ac8411899d40ad
Bug: 64021596
Change-Id: I7c544fd15e2c58784f8babc31877ad0dfeebb4c0
Diffstat (limited to 'tests/unit/src/com/android/tv/data/ProgramTest.java')
-rw-r--r-- | tests/unit/src/com/android/tv/data/ProgramTest.java | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/tests/unit/src/com/android/tv/data/ProgramTest.java b/tests/unit/src/com/android/tv/data/ProgramTest.java index 7e474cd6..1d1f6c10 100644 --- a/tests/unit/src/com/android/tv/data/ProgramTest.java +++ b/tests/unit/src/com/android/tv/data/ProgramTest.java @@ -17,17 +17,18 @@ package com.android.tv.data; import static android.media.tv.TvContract.Programs.Genres.COMEDY; import static android.media.tv.TvContract.Programs.Genres.FAMILY_KIDS; - -import com.android.tv.data.Program.CriticScore; -import com.android.tv.dvr.SeriesRecording; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; import android.media.tv.TvContentRating; import android.media.tv.TvContract.Programs.Genres; import android.os.Parcel; import android.support.test.filters.SmallTest; -import android.util.Log; -import junit.framework.TestCase; +import com.android.tv.data.Program.CriticScore; + +import org.junit.Test; import java.util.ArrayList; import java.util.Arrays; @@ -37,19 +38,20 @@ import java.util.List; * Tests for {@link Program}. */ @SmallTest -public class ProgramTest extends TestCase { - +public class ProgramTest { private static final int NOT_FOUND_GENRE = 987; private static final int FAMILY_GENRE_ID = GenreItems.getId(FAMILY_KIDS); private static final int COMEDY_GENRE_ID = GenreItems.getId(COMEDY); + @Test public void testBuild() { Program program = new Program.Builder().build(); assertEquals("isValid", false, program.isValid()); } + @Test public void testNoGenres() { Program program = new Program.Builder() .setCanonicalGenres("") @@ -61,6 +63,7 @@ public class ProgramTest extends TestCase { assertHasGenre(program, GenreItems.ID_ALL_CHANNELS, true); } + @Test public void testFamilyGenre() { Program program = new Program.Builder() .setCanonicalGenres(FAMILY_KIDS) @@ -72,6 +75,7 @@ public class ProgramTest extends TestCase { assertHasGenre(program, GenreItems.ID_ALL_CHANNELS, true); } + @Test public void testFamilyComedyGenre() { Program program = new Program.Builder() .setCanonicalGenres(FAMILY_KIDS + ", " + COMEDY) @@ -83,6 +87,7 @@ public class ProgramTest extends TestCase { assertHasGenre(program, GenreItems.ID_ALL_CHANNELS, true); } + @Test public void testOtherGenre() { Program program = new Program.Builder() .setCanonicalGenres("other") @@ -94,7 +99,8 @@ public class ProgramTest extends TestCase { assertHasGenre(program, GenreItems.ID_ALL_CHANNELS, true); } - public void testParcelable() throws Exception { + @Test + public void testParcelable() { List<CriticScore> criticScores = new ArrayList<>(); criticScores.add(new CriticScore("1", "2", "3")); criticScores.add(new CriticScore("4", "5", "6")); @@ -139,6 +145,7 @@ public class ProgramTest extends TestCase { } } + @Test public void testParcelableWithCriticScore() { Program program = new Program.Builder() .setTitle("MyTitle") |