2014-06-30 16:57:14 -05:00
|
|
|
|
namespace Ficdown.Parser.Tests
|
2014-06-30 11:59:56 -05:00
|
|
|
|
{
|
2014-07-27 00:43:32 -05:00
|
|
|
|
using System;
|
2014-07-01 01:51:08 -05:00
|
|
|
|
using System.Linq;
|
2014-06-30 16:57:14 -05:00
|
|
|
|
using System.Text;
|
2014-07-02 23:11:36 -05:00
|
|
|
|
using Player;
|
2014-07-27 00:43:32 -05:00
|
|
|
|
using ServiceStack.Text;
|
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();
|
2014-07-01 01:51:08 -05:00
|
|
|
|
var storyText = Encoding.UTF8.GetString(Resources.TheRobotKing);
|
2014-06-30 16:57:14 -05:00
|
|
|
|
var story = parser.ParseStory(storyText);
|
|
|
|
|
Assert.NotNull(story);
|
2014-07-01 01:51:08 -05:00
|
|
|
|
Assert.Equal("The Robot King", story.Name);
|
|
|
|
|
Assert.Equal("Robot Cave", story.Scenes[story.FirstScene].First().Name);
|
2014-07-02 23:11:36 -05:00
|
|
|
|
|
2014-07-26 23:54:50 -05:00
|
|
|
|
var traverser = new GameTraverser(story);
|
|
|
|
|
var test = traverser.Enumerate();
|
2014-07-27 00:43:32 -05:00
|
|
|
|
Console.WriteLine(test.Take(10).Dump());
|
2014-06-30 16:57:14 -05:00
|
|
|
|
}
|
2014-06-30 11:59:56 -05:00
|
|
|
|
}
|
|
|
|
|
}
|