Newsbot.Collector/Newsbot.Collector.Tests/Services/BrowserClientTests.cs
James Tombleson adb4799206
Features/missing files (#14)
* Added jobs Controller to trigger collection.

* Added backgroundjobs to move them out of program.cs

* new column to track youtube ID values and adding a sourceid column on the icon for linking

* Added icon table repo

* added interface for IconsRepo

* hey the missing config models

* adding section const keys to pull blocks of configs

* Added youtubewatcher to the code but not ready to enable it in the background.  More testing needed.

* Test... improvements?
2023-03-31 23:00:15 -07:00

29 lines
840 B
C#

using Newsbot.Collector.Services.HtmlParser;
namespace Newsbot.Collector.Tests.Services;
public class BrowserClientTests
{
[Fact]
public void LoadsBrowser()
{
using var client = new BrowserClient();
var pageSource = client.GetPageSource("https://www.google.com");
if (pageSource == "") Assert.Fail("failed to return page source");
}
[Fact]
public void CanLoadHeadersFromSource()
{
using var bClient = new BrowserClient();
var pageSource = bClient.GetPageSource("https://www.youtube.com/gamegrumps");
var hClient = new HtmlPageReader(new HtmlPageReaderOptions
{
SourceCode = pageSource
});
hClient.Parse();
if (hClient.Data.Header.YoutubeChannelID is null) Assert.Fail("Failed to find the YoutubeChannelId");
}
}