ficdown/Ficdown.Parser.Tests/IntegrationTests.cs

27 lines
831 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.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()
{
Logger.Initialize(true);
2014-06-30 16:57:14 -05:00
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");
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
}
}