using System; using System.Collections.Generic; using System.Threading.Tasks; using FinlyticEngine.Services.Mqtt; namespace FinlyticEngine.Tests.TestSupport; /// /// Fake for . Records every published MQTT event so tests can assert on /// fire-and-forget notifications without a real broker (Rules.md ยง13: isolated, non-destructive tests only). /// public class FakeEngineRpcClient : IEngineRpcClient { public List<(string Topic, object? Data)> PublishedMessages { get; } = new(); /// public Task SendRpcRequestAsync(string channel, TRequest requestData, TimeSpan? timeout = null) where TResponse : class where TRequest : class => throw new InvalidOperationException( "SendRpcRequestAsync is only used by EvaluateAssetAsync, which is out of scope for the tenant-boundary tests in this suite."); /// public Task PublishAsync(string topic, T data, bool retain = false) { PublishedMessages.Add((topic, data)); return Task.CompletedTask; } }