use of io.github.hidroh.materialistic.test.TestItem in project materialistic by hidroh.
the class HackerNewsItemTest method testGetTypeDefault.
@Test
public void testGetTypeDefault() {
item.populate(new TestItem() {
@Override
public String getRawType() {
return null;
}
});
assertEquals(Item.STORY_TYPE, item.getType());
}
use of io.github.hidroh.materialistic.test.TestItem in project materialistic by hidroh.
the class HackerNewsItemTest method testKidCount.
@Test
public void testKidCount() {
item.populate(new TestItem() {
@Override
public int getDescendants() {
return 10;
}
});
assertEquals(10, item.getKidCount());
}
use of io.github.hidroh.materialistic.test.TestItem in project materialistic by hidroh.
the class HackerNewsItemTest method testLastKidCount.
@Test
public void testLastKidCount() {
item.populate(new TestItem() {
@Override
public int getDescendants() {
return 0;
}
});
assertEquals(0, item.getLastKidCount());
item.setLastKidCount(1);
assertEquals(1, item.getLastKidCount());
}
use of io.github.hidroh.materialistic.test.TestItem in project materialistic by hidroh.
the class HackerNewsItemTest method testGetTypeInvalid.
@Test
public void testGetTypeInvalid() {
item.populate(new TestItem() {
@Override
public String getRawType() {
return "blah";
}
});
assertEquals("blah", item.getType());
}
use of io.github.hidroh.materialistic.test.TestItem in project materialistic by hidroh.
the class HackerNewsItemTest method testParcelReadWrite.
@Test
public void testParcelReadWrite() {
Parcel parcel = Parcel.obtain();
item.populate(new TestItem() {
@Override
public String getTitle() {
return "title";
}
});
item.writeToParcel(parcel, 0);
parcel.setDataPosition(0);
Item actual = HackerNewsItem.CREATOR.createFromParcel(parcel);
assertEquals("title", actual.getDisplayedTitle());
assertFalse(actual.isFavorite());
}
Aggregations