using ZB.MOM.WW.MxGateway.Worker.MxAccess;

namespace ZB.MOM.WW.MxGateway.Worker.Tests.TestSupport;

/// <summary>
/// Shared no-operation <see cref="IMxAccessServer"/> for tests that need to
/// construct an <see cref="MxAccessSession"/> via
/// <see cref="MxAccessSession.CreateForTesting"/> but do not exercise any
/// MXAccess COM call. Replaces the per-file <c>NullMxAccessServer</c> copy
/// that previously lived inside <c>AlarmCommandExecutorTests</c> and was
/// constructed via reflection — see Worker.Tests-016 for the rationale.
/// </summary>
internal sealed class NoopMxAccessServer : IMxAccessServer
{
    /// <inheritdoc />
    public int Register(string clientName) => 0;

    /// <inheritdoc />
    public void Unregister(int serverHandle)
    {
    }

    /// <inheritdoc />
    public int AddItem(int serverHandle, string itemDefinition) => 0;

    /// <inheritdoc />
    public int AddItem2(int serverHandle, string itemDefinition, string itemContext) => 0;

    /// <inheritdoc />
    public void RemoveItem(int serverHandle, int itemHandle)
    {
    }

    /// <inheritdoc />
    public void Advise(int serverHandle, int itemHandle)
    {
    }

    /// <inheritdoc />
    public void UnAdvise(int serverHandle, int itemHandle)
    {
    }

    /// <inheritdoc />
    public void AdviseSupervisory(int serverHandle, int itemHandle)
    {
    }

    /// <inheritdoc />
    public int AddBufferedItem(int serverHandle, string itemDefinition, string itemContext) => 0;

    /// <inheritdoc />
    public void SetBufferedUpdateInterval(int serverHandle, int updateIntervalMilliseconds)
    {
    }

    /// <inheritdoc />
    public void Suspend(int serverHandle, int itemHandle)
    {
    }

    /// <inheritdoc />
    public void Activate(int serverHandle, int itemHandle)
    {
    }

    /// <inheritdoc />
    public void Write(int serverHandle, int itemHandle, object? value, int userId)
    {
    }

    /// <inheritdoc />
    public void Write2(int serverHandle, int itemHandle, object? value, object? timestampValue, int userId)
    {
    }

    /// <inheritdoc />
    public void WriteSecured(int serverHandle, int itemHandle, int currentUserId, int verifierUserId, object? value)
    {
    }

    /// <inheritdoc />
    public void WriteSecured2(int serverHandle, int itemHandle, int currentUserId, int verifierUserId, object? value, object? timestampValue)
    {
    }

    /// <inheritdoc />
    public int AuthenticateUser(string userName, string password) => 0;

    /// <inheritdoc />
    public int ArchestrAUserToId(string userName) => 0;
}
