using ZB.MOM.WW.MxGateway.Contracts.Proto;
using ZB.MOM.WW.MxGateway.Server.Dashboard.Hubs;

namespace ZB.MOM.WW.MxGateway.IntegrationTests.TestSupport;

/// <summary>
/// No-op <see cref="IDashboardEventBroadcaster"/> for integration tests that
/// construct an <see cref="ZB.MOM.WW.MxGateway.Server.Grpc.EventStreamService"/>
/// without exercising the dashboard SignalR fan-out. Singleton because the
/// type holds no state — every consumer can share <see cref="Instance"/>.
/// The unit-test project owns a parallel copy under
/// <c>ZB.MOM.WW.MxGateway.Tests/TestSupport/</c>; IntegrationTests keeps its
/// own copy here so the two test projects stay independently buildable
/// without a shared test-helpers project.
/// </summary>
public sealed class NullDashboardEventBroadcaster : IDashboardEventBroadcaster
{
    /// <summary>Shared no-op instance.</summary>
    public static readonly NullDashboardEventBroadcaster Instance = new();

    private NullDashboardEventBroadcaster()
    {
    }

    /// <inheritdoc />
    public void Publish(string sessionId, MxEvent mxEvent)
    {
        // Intentionally empty — integration tests assert directly on the gRPC
        // stream writer, not on dashboard fan-out.
    }
}
