import eu.toldi.rss.Feed;
import eu.toldi.rss.FeedGroup;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;

public class FeedGroupTest {

    private FeedGroup testGroup;
    private Feed feed1;

    @Before
    public void setup() throws IOException {
        testGroup = new FeedGroup("New Feed Group");
        feed1 = new Feed(new URL("https://www.rssboard.org/files/sample-rss-2.xml"));
    }

    @Test
    public void sanityCheck(){
        Assert.assertEquals(0,testGroup.getArticleCount());
        Assert.assertEquals("New Feed Group",testGroup.getName());
        Assert.assertEquals(4,feed1.getArticleCount());
    }

    @Test
    public void addFeedTest(){
        testGroup.addFeed(feed1);
        Assert.assertEquals(4,testGroup.getArticleCount());
    }

}
