feat: multidivert; more tests

This commit is contained in:
mattia
2025-03-01 18:03:42 +01:00
parent 6ee8051004
commit 43745e75e7
11 changed files with 276 additions and 212 deletions

View File

@@ -1,4 +1,5 @@
using System.Text;
using InkBlot.ParseHierarchy;
using Microsoft.Extensions.Logging;
namespace InkBlot.Tests;
@@ -22,4 +23,20 @@ internal static class Helpers
var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole());
return loggerFactory;
}
}
public class TestBase
{
protected (Story, Diagnostic[]) ParseText(string inkInput)
{
// parse the story
var fileReader = new InMemoryFileReader([
("main.ink", inkInput)
]);
using var loggerFactory = Helpers.GetLoggerFactory();
var (story, diagnosticsEnumerable) = InkBlotParser.Parse(fileReader, loggerFactory, "main.ink");
var diagnostics = diagnosticsEnumerable.ToArray();
return (story, diagnostics);
}
}