use of io.github.hidroh.materialistic.test.TestItem in project materialistic by hidroh.
the class HackerNewsItemTest method testGetDisplayedTitleNonComment.
@Test
public void testGetDisplayedTitleNonComment() {
item.populate(new TestItem() {
@Override
public String getRawType() {
return "story";
}
@Override
public String getTitle() {
return "title";
}
});
assertEquals("title", item.getDisplayedTitle());
}
use of io.github.hidroh.materialistic.test.TestItem in project materialistic by hidroh.
the class HackerNewsItemTest method testGetDisplayedTitleComment.
@Test
public void testGetDisplayedTitleComment() {
item.populate(new TestItem() {
@Override
public String getRawType() {
return "comment";
}
@Override
public String getText() {
return "comment";
}
});
assertEquals("comment", item.getDisplayedTitle());
}
use of io.github.hidroh.materialistic.test.TestItem in project materialistic by hidroh.
the class HackerNewsItemTest method testGetType.
@Test
public void testGetType() {
item.populate(new TestItem() {
@Override
public String getRawType() {
return "poll";
}
});
assertEquals(Item.POLL_TYPE, item.getType());
}
use of io.github.hidroh.materialistic.test.TestItem in project materialistic by hidroh.
the class HackerNewsItemTest method testIsShareable.
@Test
public void testIsShareable() {
assertTrue(item.isStoryType());
item.populate(new TestItem() {
@Override
public String getRawType() {
return "comment";
}
});
assertFalse(item.isStoryType());
item.populate(new TestItem() {
@Override
public String getRawType() {
return "poll";
}
});
assertTrue(item.isStoryType());
}
use of io.github.hidroh.materialistic.test.TestItem in project materialistic by hidroh.
the class HackerNewsItemTest method testHasNewKids.
@Test
public void testHasNewKids() {
assertFalse(item.hasNewKids());
item.populate(new TestItem() {
@Override
public int getDescendants() {
return 0;
}
});
assertFalse(item.hasNewKids());
item.populate(new TestItem() {
@Override
public int getDescendants() {
return 1;
}
});
assertTrue(item.hasNewKids());
item.populate(new TestItem() {
@Override
public int getDescendants() {
return 1;
}
});
assertFalse(item.hasNewKids());
}
Aggregations