feat: temporary grammar

This commit is contained in:
Mattia Belletti
2025-03-01 12:30:36 +01:00
parent aa3baa780d
commit eed28168ad
31 changed files with 1409 additions and 479 deletions

View File

@@ -1,4 +1,5 @@
using System.Text;
using Microsoft.Extensions.Logging;
namespace InkBlot.Tests;
@@ -6,10 +7,19 @@ namespace InkBlot.Tests;
/// A file reader where the contents are directly provided as strings.
/// </summary>
/// <param name="filesToContents">A map between file names and their contents.</param>
internal class PreMadeFileReader((string, string)[] filesToContents) : IFileReader
internal class InMemoryFileReader((string, string)[] filesToContents) : IFileReader
{
public Stream GetContents(string filename)
{
return new MemoryStream(Encoding.UTF8.GetBytes(filesToContents.First(e => e.Item1 == filename).Item2));
}
}
internal static class Helpers
{
public static ILoggerFactory GetLoggerFactory()
{
var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole());
return loggerFactory;
}
}