feat: parse content text (base case).
This commit is contained in:
15
InkBlot.Tests/Helpers.cs
Normal file
15
InkBlot.Tests/Helpers.cs
Normal 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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user