using Microsoft.AspNetCore.Http; using SeaHaven.Services.Interfaces; namespace SeaHavenIndustries.Tests; internal sealed class TestFileStoragePort : IFileStoragePort { private readonly Func _openRead; public TestFileStoragePort(Func? openRead = null) { _openRead = openRead ?? (_ => null); } public int TryDeleteCalls { get; private set; } public Task SaveFileAsync(IFormFile file) => Task.FromResult("https://example.test/Assets/Documents/saved.bin"); public bool TryDelete(string fileUrl) { TryDeleteCalls++; return true; } public Stream? OpenRead(string fileUrl) => _openRead(fileUrl); }