feat: parse content text (base case).

This commit is contained in:
mattia
2025-02-16 18:26:28 +01:00
parent b7aae9a04f
commit d386c50499
32 changed files with 940 additions and 6 deletions

15
InkBlot.Tests/Helpers.cs Normal file
View File

@@ -0,0 +1,15 @@
using System.Text;
namespace InkBlot.Tests;
/// <summary>
/// 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
{
public Stream GetContents(string filename)
{
return new MemoryStream(Encoding.UTF8.GetBytes(filesToContents.First(e => e.Item1 == filename).Item2));
}
}