ficdown/Ficdown.Parser.Tests/IntegrationTests.cs

29 lines
844 B
C#
Raw Normal View History

2014-06-30 16:57:14 -05:00
namespace Ficdown.Parser.Tests
2014-06-30 11:59:56 -05:00
{
using System;
using System.IO;
2014-06-30 16:57:14 -05:00
using System.Text;
using Render;
2014-06-30 16:57:14 -05:00
using TestStories;
using Xunit;
public class IntegrationTests
2014-06-30 11:59:56 -05:00
{
2014-06-30 16:57:14 -05:00
[Fact]
public void CanParseValidStoryFile()
{
var parser = new FicdownParser();
var storyText = Encoding.UTF8.GetString(Resources.CloakOfDarkness);
2014-06-30 16:57:14 -05:00
var story = parser.ParseStory(storyText);
var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "itest_output");
if (!Directory.Exists(path)) Directory.CreateDirectory(path);
foreach (var file in Directory.GetFiles(path))
{
File.Delete(file);
}
2017-04-13 11:50:07 -05:00
var rend = new HtmlRenderer("en");
rend.Render(story, path, true);
2014-06-30 16:57:14 -05:00
}
2014-06-30 11:59:56 -05:00
}
}