2014-06-30 16:57:14 -05:00
|
|
|
|
namespace Ficdown.Parser.Tests
|
2014-06-30 11:59:56 -05:00
|
|
|
|
{
|
2014-08-10 11:10:21 -05:00
|
|
|
|
using System.IO;
|
|
|
|
|
using Render;
|
2014-06-30 16:57:14 -05:00
|
|
|
|
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();
|
2019-01-16 16:20:24 -06:00
|
|
|
|
var storyText = File.ReadAllText(Path.Combine(Template.BaseDir, "TestStories", "CloakOfDarkness.md"));
|
2014-06-30 16:57:14 -05:00
|
|
|
|
var story = parser.ParseStory(storyText);
|
2019-01-16 16:20:24 -06:00
|
|
|
|
var path = Path.Combine(Template.BaseDir, "itest_output");
|
2014-08-10 11:10:21 -05:00
|
|
|
|
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");
|
2014-08-10 15:25:20 -05:00
|
|
|
|
rend.Render(story, path, true);
|
2014-06-30 16:57:14 -05:00
|
|
|
|
}
|
2014-06-30 11:59:56 -05:00
|
|
|
|
}
|
|
|
|
|
}
|