Validate that the *new* and *played* states are exclusive
This commit is contained in:
parent
c6344f5bc0
commit
3c7fd274de
|
@ -5,6 +5,7 @@ import org.junit.Test;
|
|||
|
||||
import static de.danoeh.antennapod.core.feed.FeedItemMother.anyFeedItemWithImage;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
||||
public class FeedItemTest {
|
||||
|
||||
|
@ -39,6 +40,28 @@ public class FeedItemTest {
|
|||
assertFeedItemImageWasUpdated();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that a played item loses that state after being marked as new.
|
||||
*/
|
||||
@Test
|
||||
public void testMarkPlayedItemAsNew_itemNotPlayed() {
|
||||
original.setPlayed(true);
|
||||
original.setNew();
|
||||
|
||||
assertFalse(original.isPlayed());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that a new item loses that state after being marked as played.
|
||||
*/
|
||||
@Test
|
||||
public void testMarkNewItemAsPlayed_itemNotNew() {
|
||||
original.setNew();
|
||||
original.setPlayed(true);
|
||||
|
||||
assertFalse(original.isNew());
|
||||
}
|
||||
|
||||
private void setNewFeedItemImageDownloadUrl() {
|
||||
changedFeedItem.setImageUrl("http://example.com/new_picture");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue