public void ParseRemotePressNewsShouldWorkCorrectlyWhenTextIsEmpty() { const string NewsUrl = "https://www.nsi.bg/bg/content/13808/%D0%BF%D1%80%D0%B5%D1%81%D1%81%D1%8A%D0%BE%D0%B1%D1%89%D0%B5%D0%BD%D0%B8%D0%B5/%D0%BA%D0%BB%D1%8E%D1%87%D0%BE%D0%B2%D0%B8-%D0%BF%D0%BE%D0%BA%D0%B0%D0%B7%D0%B0%D1%82%D0%B5%D0%BB%D0%B8-%D0%B7%D0%B0-%D0%B1%D1%8A%D0%BB%D0%B3%D0%B0%D1%80%D0%B8%D1%8F-%D0%BA%D1%8A%D0%BC-30122015-%D0%B3"; var provider = new NsiBgPressSource(); var news = provider.GetPublication(NewsUrl); Assert.Equal(NewsUrl, news.OriginalUrl); Assert.Equal("Ключови показатели за България (към 30.12.2015 г.)", news.Title); Assert.Contains("https://www.nsi.bg/sites/default/files/files/pressreleases/KeyInd2015-12_2U0QR4H.pdf", news.Content); Assert.Null(news.ImageUrl); Assert.Equal(new DateTime(2015, 12, 30, 11, 0, 0), news.PostDate); Assert.Equal("13808", news.RemoteId); }
public void ParseRemotePressNewsShouldWorkCorrectlyWhenTextIsEmpty() { const string NewsUrl = "https://nsi.bg/bg/content/13808/прессъобщение/ключови-показатели-за-българия-към-30122015-г"; var provider = new NsiBgPressSource(); var news = provider.GetPublication(NewsUrl); Assert.Equal(NewsUrl, news.OriginalUrl); Assert.Equal("Ключови показатели за България (към 30.12.2015 г.)", news.Title); Assert.Contains("https://nsi.bg/sites/default/files/files/pressreleases/KeyInd2015-12_2U0QR4H.pdf", news.Content); Assert.Null(news.ImageUrl); Assert.Equal(new DateTime(2015, 12, 30, 11, 0, 0), news.PostDate); Assert.Equal("13808", news.RemoteId); }
public void ParseRemotePressNewsShouldWorkCorrectly() { const string NewsUrl = "https://www.nsi.bg/bg/content/13839/%D0%BF%D1%80%D0%B5%D1%81%D1%81%D1%8A%D0%BE%D0%B1%D1%89%D0%B5%D0%BD%D0%B8%D0%B5/%D0%B4%D0%B5%D0%B9%D0%BD%D0%BE%D1%81%D1%82-%D0%BD%D0%B0-%D0%BC%D0%B5%D1%81%D1%82%D0%B0%D1%82%D0%B0-%D0%B7%D0%B0-%D0%BD%D0%B0%D1%81%D1%82%D0%B0%D0%BD%D1%8F%D0%B2%D0%B0%D0%BD%D0%B5-%D0%BF%D1%80%D0%B5%D0%B7-%D0%BD%D0%BE%D0%B5%D0%BC%D0%B2%D1%80%D0%B8-2015-%D0%B3%D0%BE%D0%B4%D0%B8%D0%BD%D0%B0"; var provider = new NsiBgPressSource(); var news = provider.GetPublication(NewsUrl); Assert.Equal(NewsUrl, news.OriginalUrl); Assert.Equal("Дейност на местата за настаняване през ноември 2015 година", news.Title); Assert.Contains("През ноември 2015 г. в страната са функционирали", news.Content); Assert.Contains("или с 0.8% повече в сравнение с ноември 2014 година.", news.Content); Assert.Null(news.ImageUrl); Assert.Equal(new DateTime(2016, 1, 14, 11, 0, 0), news.PostDate); Assert.Equal("13839", news.RemoteId); }