Search in sources :

Example 21 with Content

use of com.amazon.android.model.content.Content in project zype-firebuilder by zype.

the class ContentTranslatorTest method testValidateModelFalseUrl.

/**
 * Tests the {@link ContentTranslator#validateModel(Content)} method for the false case where
 * the url is invalid.
 */
@Test
public void testValidateModelFalseUrl() throws Exception {
    Content content = createValidContent();
    // make good content bad
    content.setUrl("");
    assertFalse(mContentTranslator.validateModel(content));
}
Also used : Content(com.amazon.android.model.content.Content) Test(org.junit.Test)

Example 22 with Content

use of com.amazon.android.model.content.Content in project zype-firebuilder by zype.

the class ContentTranslatorTest method testSetMemberVariableCardImageUrl.

/**
 * Tests the {@link ContentTranslator#setMemberVariable(Content, String, Object)} method for
 * the cardImageUrl member variable.
 */
@Test
public void testSetMemberVariableCardImageUrl() throws Exception {
    String urlText = "www.someUrl.com";
    Content content = new Content();
    assertTrue(mContentTranslator.setMemberVariable(content, "mCardImageUrl", urlText));
    assertEquals(content.getCardImageUrl(), urlText);
}
Also used : Content(com.amazon.android.model.content.Content) Test(org.junit.Test)

Example 23 with Content

use of com.amazon.android.model.content.Content in project zype-firebuilder by zype.

the class ContentTranslatorTest method testSetMemberVariableSubtitle.

/**
 * Tests the {@link ContentTranslator#setMemberVariable(Content, String, Object)} method for
 * the subtitle member variable.
 */
@Test
public void testSetMemberVariableSubtitle() throws Exception {
    String subtitleText = "A subtitle";
    Content content = new Content();
    assertTrue(mContentTranslator.setMemberVariable(content, "mSubtitle", subtitleText));
    assertEquals(content.getSubtitle(), subtitleText);
}
Also used : Content(com.amazon.android.model.content.Content) Test(org.junit.Test)

Example 24 with Content

use of com.amazon.android.model.content.Content in project zype-firebuilder by zype.

the class ContentTranslatorTest method testSetMemberVariableBackgroundImageUrl.

/**
 * Tests the {@link ContentTranslator#setMemberVariable(Content, String, Object)} method for
 * the backgroundImageUrl member variable.
 */
@Test
public void testSetMemberVariableBackgroundImageUrl() throws Exception {
    String urlText = "www.someUrl.com";
    Content content = new Content();
    assertTrue(mContentTranslator.setMemberVariable(content, "mBackgroundImageUrl", urlText));
    assertEquals(content.getBackgroundImageUrl(), urlText);
}
Also used : Content(com.amazon.android.model.content.Content) Test(org.junit.Test)

Example 25 with Content

use of com.amazon.android.model.content.Content in project zype-firebuilder by zype.

the class ContentTranslatorTest method testSetMemberVariableId.

/**
 * Tests the {@link ContentTranslator#setMemberVariable(Content, String, Object)} method for
 * the id member variable.
 */
@Test
public void testSetMemberVariableId() throws Exception {
    Content content = new Content();
    assertTrue(mContentTranslator.setMemberVariable(content, "mId", "1"));
    assertEquals(content.getId(), "1");
}
Also used : Content(com.amazon.android.model.content.Content) Test(org.junit.Test)

Aggregations

Content (com.amazon.android.model.content.Content)76 ContentContainer (com.amazon.android.model.content.ContentContainer)28 Test (org.junit.Test)26 ArrayObjectAdapter (androidx.leanback.widget.ArrayObjectAdapter)13 ListRow (androidx.leanback.widget.ListRow)13 ArrayList (java.util.ArrayList)11 Recipe (com.amazon.android.recipe.Recipe)10 Intent (android.content.Intent)8 RecentDatabaseHelper (com.amazon.android.contentbrowser.database.helpers.RecentDatabaseHelper)7 TextUtils (android.text.TextUtils)6 RecentRecord (com.amazon.android.contentbrowser.database.records.RecentRecord)6 CardPresenter (com.amazon.android.tv.tenfoot.presenter.CardPresenter)6 List (java.util.List)6 Context (android.content.Context)5 HeaderItem (androidx.leanback.widget.HeaderItem)5 Action (com.amazon.android.model.Action)5 NavigatorModel (com.amazon.android.navigator.NavigatorModel)5 AndroidSchedulers (rx.android.schedulers.AndroidSchedulers)5 Bundle (android.os.Bundle)4 Log (android.util.Log)4