feat: multidivert; more tests
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user