using System.Text;
using Microsoft.Extensions.Logging;
namespace InkBlot.Tests;
///
/// A file reader where the contents are directly provided as strings.
///
/// A map between file names and their contents.
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;
}
}