Compare commits
2 Commits
fd60906a20
...
df348bea5a
Author | SHA1 | Date | |
---|---|---|---|
df348bea5a | |||
008d79cf3d |
@ -36,11 +36,19 @@ public class HtmlPageReader
|
|||||||
private string ReadSiteContent(string url)
|
private string ReadSiteContent(string url)
|
||||||
{
|
{
|
||||||
using var client = new HttpClient();
|
using var client = new HttpClient();
|
||||||
var html = client.GetStringAsync(url);
|
try
|
||||||
html.Wait();
|
{
|
||||||
|
var html = client.GetStringAsync(url);
|
||||||
|
html.Wait();
|
||||||
|
|
||||||
var content = html.Result;
|
var content = html.Result;
|
||||||
return content;
|
return content;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Failed to connect to '{url}'. {ex.Message}");
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetSiteContent()
|
public string GetSiteContent()
|
||||||
|
@ -23,7 +23,8 @@ public class ArticlesTableTests
|
|||||||
public void ArticlesListTest()
|
public void ArticlesListTest()
|
||||||
{
|
{
|
||||||
var cfg = GetConfiguration();
|
var cfg = GetConfiguration();
|
||||||
var client = new ArticlesTable(cfg);
|
var dbconn = cfg.GetConnectionString("Database");
|
||||||
|
var client = new ArticlesTable(dbconn ?? "");
|
||||||
client.List(0, 25);
|
client.List(0, 25);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,7 +34,8 @@ public class ArticlesTableTests
|
|||||||
var uid = Guid.Parse("4ac46772-253c-4c3d-8a2c-29239abd2ad4");
|
var uid = Guid.Parse("4ac46772-253c-4c3d-8a2c-29239abd2ad4");
|
||||||
|
|
||||||
var cfg = GetConfiguration();
|
var cfg = GetConfiguration();
|
||||||
var client = new ArticlesTable(cfg);
|
var dbconn = cfg.GetConnectionString("Database");
|
||||||
|
var client = new ArticlesTable(dbconn ?? "");
|
||||||
var res = client.GetById(uid);
|
var res = client.GetById(uid);
|
||||||
if (!res.Id.Equals(uid))
|
if (!res.Id.Equals(uid))
|
||||||
{
|
{
|
||||||
@ -45,7 +47,8 @@ public class ArticlesTableTests
|
|||||||
public void NewRecordTest()
|
public void NewRecordTest()
|
||||||
{
|
{
|
||||||
var cfg = GetConfiguration();
|
var cfg = GetConfiguration();
|
||||||
var client = new ArticlesTable(cfg);
|
var dbconn = cfg.GetConnectionString("Database");
|
||||||
|
var client = new ArticlesTable(dbconn ?? "");
|
||||||
var m = new ArticlesEntity
|
var m = new ArticlesEntity
|
||||||
{
|
{
|
||||||
Id = Guid.NewGuid(),
|
Id = Guid.NewGuid(),
|
||||||
|
Loading…
Reference in New Issue
Block a user