* post: stub out initial post with outline * fix: add title attribute to lead in feed and add disc to list styles in posts * fix: apply style to artcile * post: work on rough draft * post: work on rough draft * post: work on rought draft * post: work on rought draft * post: more work on rough draft * post: finish post * chore: cleanup usings * chore: run dotnet format * docs: testing README * docs: update README.md
32 lines
759 B
C#
32 lines
759 B
C#
namespace Blog.Tests.EndToEnd;
|
|
|
|
[TestFixture]
|
|
public class RssTests : BlogTest
|
|
{
|
|
[Test]
|
|
public async Task Rss_WhenFetched_ItShouldReturnRssFeed()
|
|
{
|
|
var response = await Page.APIRequest.GetAsync("/rss");
|
|
response.Status.Should().Be((int)HttpStatusCode.OK);
|
|
|
|
var xml = await response.BodyAsync();
|
|
|
|
var streamReader = new StreamReader(
|
|
new MemoryStream(xml),
|
|
Encoding.UTF8
|
|
);
|
|
|
|
|
|
var settings = new XmlReaderSettings
|
|
{
|
|
Async = true
|
|
};
|
|
|
|
using var xmlReader = XmlReader.Create(streamReader, settings);
|
|
var feed = SyndicationFeed.Load(xmlReader);
|
|
|
|
feed.Title.Text.Should().Be("journal");
|
|
feed.Description.Text.Should().Be("A blog by Stevan Freeborn");
|
|
feed.Items.Should().HaveCount(2);
|
|
}
|
|
} |