Implemented DLSiteClient.

This commit is contained in:
2025-09-08 17:08:47 -04:00
parent 429252e61f
commit f250276a99
39 changed files with 1584 additions and 173 deletions

View File

@@ -0,0 +1,23 @@
using System.Reflection;
using System.Text;
namespace JSMR.Tests.Utilities;
public static class ResourceHelper
{
/// <summary>
/// Reads an embedded resource from the calling assembly.
/// </summary>
/// <param name="resourceName">The full resource name, e.g. "MyNamespace.Folder.sample.json".</param>
public static async Task<string> ReadAsync(string resourceName)
{
Assembly assmbly = Assembly.GetExecutingAssembly();
using Stream? stream = assmbly.GetManifestResourceStream(resourceName)
?? throw new FileNotFoundException($"Resource '{resourceName}' not found.");
using StreamReader reader = new(stream, Encoding.UTF8);
return await reader.ReadToEndAsync();
}
}