====== New Feed Checker ======
In this homework, we will develop a small software that checks if the feeds that we subscribed have any updates.
===== Basic components =====
Our main object, a **''FeedChecker''**, uses two other objects: a ''FeedReader'' and a ''FeedDatabase''.
* A ''FeedReader'' provides the following methods:
* ''fetch()'' reads the content of the feed.
* ''getEntries()'' returns the list of entries in the feed.
* ''getTitles()'' returns the list of titles of all entries.
* A ''FeedDatabase'' provides the following methods:
* ''getTitles()'' returns the list of titles of all entries.
The following interfaces describe both classes.
import java.util.List;
public interface FeedReader {
List getTitles();
void fetch();
}
import java.util.List;
public interface FeedDatabase {
List getTitles();
}
Following is the skeleton of the Class Under Test, ''FeedChecker''.
import java.util.List;
public class FeedChecker {
public FeedChecker(FeedReader reader, FeedDatabase db) {}
public void check() {}
public List getNewTitles() {}
}
When method ''check()'' is called, a ''FeedChecker'' would invoke ''fetch'' from the ''FeedReader'', then compares the list of titles returned from ''FeedReader'' and the titles returned from ''FeedDatabase''. Method ''getNewTitle()'' returns a list of new titles, i.e., those titles returned by ''FeedReader'' which are not returned by ''FeedDatabase''.
===== FeedCheckerTest =====
Your task is to develop a unit test ''FeedCheckerTest'' for ''FeedChecker''. You should include at least 3 interesting test cases (Recall the slides on 'what to test'?). Also, you have to implement ''FeedChecker'' so that it passes all test cases.
**Don't implement ''FeedReader'' or ''FeedDatabase''. You should mock them instead.**