Beispiel #1
0
        public WallaProvider(HttpClient httpClient = null)
        {
            httpClient ??= new HttpClient();

            _rss = new RssFeedProvider(
                httpClient,
                "https://rss.walla.co.il/feed/1?type=main");
        }
Beispiel #2
0
        public HaaretzProvider(HttpClient httpClient = null)
        {
            httpClient ??= new HttpClient();

            _rss = new RssFeedProvider(
                httpClient,
                "https://www.haaretz.co.il/cmlink/1.1617539");
        }
Beispiel #3
0
        public TheMarkerProvider(HttpClient httpClient = null)
        {
            httpClient ??= new HttpClient();

            _rss = new RssFeedProvider(
                httpClient,
                "https://www.themarker.com/cmlink/1.144");
        }
Beispiel #4
0
        public N0404Provider(HttpClient httpClient = null)
        {
            httpClient ??= new HttpClient();

            _rss = new RssFeedProvider(
                httpClient,
                "https://www.0404.co.il/?call_custom_simple_rss=1&csrp_cat=14");
        }
Beispiel #5
0
        public YnetProvider(HttpClient httpClient = null)
        {
            httpClient ??= new HttpClient();

            _rss = new RssFeedProvider(
                httpClient,
                "http://www.ynet.co.il/Integration/StoryRss2.xml");
        }
Beispiel #6
0
        public MakoProvider(HttpClient httpClient = null)
        {
            httpClient ??= new HttpClient();

            _rss = new RssFeedProvider(
                httpClient,
                "http://rcs.mako.co.il/rss/31750a2610f26110VgnVCM1000005201000aRCRD.xml");
        }
Beispiel #7
0
        public CalcalistProvider(HttpClient httpClient = null)
        {
            httpClient ??= new HttpClient();

            _rss = new RssFeedProvider(
                httpClient,
                "https://www.calcalist.co.il/GeneralRSS/0,16335,L-8,00.xml");
        }
        public CalcalistReportsProvider(HttpClient httpClient = null)
        {
            httpClient ??= new HttpClient();

            _rss = new RssFeedProvider(
                httpClient,
                "http://www.ynet.co.il/Integration/StoryRss1854.xml");
        }
Beispiel #9
0
        public WallaReportsProvider(HttpClient httpClient = null)
        {
            httpClient ??= new HttpClient();

            _rss = new RssFeedProvider(
                httpClient,
                "https://rss.walla.co.il/feed/22");
        }
Beispiel #10
0
        public void ReadFeedContent()
        {
            var feedItems = new List <FeedItem>()
            {
                new FeedItem()
                {
                    Id      = "id1",
                    Summary = "summary1"
                },
                new FeedItem()
                {
                    Id      = "id2",
                    Summary = "summary2"
                }
            };
            var newsFeedItems = new List <NewsFeedItemDTO>()
            {
                new NewsFeedItemDTO()
                {
                    Id      = "id1",
                    Summary = "summary1"
                },
                new NewsFeedItemDTO()
                {
                    Id      = "id2",
                    Summary = "summary2"
                }
            };

            ISimpleFeedAccess feedAccess = Substitute.For <ISimpleFeedAccess>();

            feedAccess.ReadFeed("example.com").Returns(feedItems);
            IMapper mapper = Substitute.For <IMapper>();

            mapper.Map <List <NewsFeedItemDTO> >(feedItems).Returns(newsFeedItems);

            var feedProvider = new RssFeedProvider(mapper, feedAccess);

            var result = feedProvider.ReadFeedContent("example.com");

            Assert.Equal(2, result.Count);
        }