w4c-workflows-api/w4c-workflows-api.Tests/BinaryTestData.cs

20 lines
671 B
C#
Raw Permalink Normal View History

2026-09-11 22:02:46 +00:00
using w4c_workflows.Services.Nodes.Binary;
namespace w4c_workflows.Tests;
/// <summary>
/// Builds an isolated <see cref="FileSystemBinaryStore"/> in a fresh temp
/// directory per call, so binary tests never share state or touch the repo.
/// </summary>
internal static class BinaryTestData
{
public static FileSystemBinaryStore Store(Action<BinaryStoreOptions>? configure = null)
{
var root = Path.Combine(
Path.GetTempPath(), "w4c-binary-tests", Guid.NewGuid().ToString("N"));
var options = new BinaryStoreOptions { RootPath = root };
configure?.Invoke(options);
return new FileSystemBinaryStore(options);
}
}