Newsbot.Collector/Newsbot.Collector.Tests/Tables/ArticlesTableTests.cs
James Tombleson 9f3a6323a6
Features/html meta extractor (#4)
* gave api access to the db project

* added db models

* working on rss extraction and meta extraction

* test project to debug rsswatcherjob

* added new configs for the project

* new interface to define collectors

* basic rss extraction and article details are now exposed

* tests updated for rss pull

* starting to get dapper working.  Query works but insert seems to have a value issue

* removed dapper from services

* added some basic tests for db calls
2023-02-16 22:19:05 -08:00

40 lines
880 B
C#

using Newsbot.Collector.Database.Repositories;
using Newsbot.Collector.Domain.Models;
namespace Newsbot.Collector.Tests.Tables;
public class ArticlesTableTests
{
[Fact]
public void ArticlesListTest()
{
var client = new ArticlesTable("");
client.List();
}
[Fact]
public void GetByIDTest()
{
var uid = Guid.Parse("4ac46772-253c-4c3d-8a2c-29239abd2ad4");
var client = new ArticlesTable("");
var res = client.GetById(uid);
if (!res.ID.Equals(uid))
{
Assert.Fail("Incorrect record or not found");
}
}
[Fact]
public void NewRecordTest()
{
var client = new ArticlesTable("");
client.New(new ArticlesModel
{
Title = "Unit Testing!",
SourceID = Guid.NewGuid(),
PubDate = DateTime.Now
});
}
}