From c589bd2022ff6e53d8b0a95547c966fd7b78e28d Mon Sep 17 00:00:00 2001 From: Borjan Tchakaloff Date: Sun, 31 Mar 2019 21:26:53 +0200 Subject: [PATCH] Validate that the *new* and *not played* are also exclusive The FeedItem state is actually a tri-state, complement the test coverage by checking that the state changes from *new* to *not played*. --- .../de/danoeh/antennapod/core/feed/FeedItemTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/src/test/java/de/danoeh/antennapod/core/feed/FeedItemTest.java b/core/src/test/java/de/danoeh/antennapod/core/feed/FeedItemTest.java index e9fe24b90..857827219 100644 --- a/core/src/test/java/de/danoeh/antennapod/core/feed/FeedItemTest.java +++ b/core/src/test/java/de/danoeh/antennapod/core/feed/FeedItemTest.java @@ -62,6 +62,17 @@ public class FeedItemTest { assertFalse(original.isNew()); } + /** + * Test that a new item loses that state after being marked as not played. + */ + @Test + public void testMarkNewItemAsNotPlayed_itemNotNew() { + original.setNew(); + original.setPlayed(false); + + assertFalse(original.isNew()); + } + private void setNewFeedItemImageDownloadUrl() { changedFeedItem.setImageUrl("http://example.com/new_picture"); }