using ZB.MOM.WW.MxGateway.Contracts;

namespace ZB.MOM.WW.MxGateway.Tests.Contracts;

public sealed class GatewayContractInfoTests
{
    /// <summary>Verifies that the default backend name is "mxaccess-worker".</summary>
    [Fact]
    public void DefaultBackendName_IsMxAccessWorker()
    {
        Assert.Equal("mxaccess-worker", GatewayContractInfo.DefaultBackendName);
    }

    /// <summary>
    ///     Pins the current <see cref="GatewayContractInfo.GatewayProtocolVersion"/>
    ///     constant at 3. Both the alarm proto extension (`AcknowledgeAlarm` /
    ///     `QueryActiveAlarms` RPCs, the `OnAlarmTransitionEvent` body, and the
    ///     alarm command/reply payload cases) and the bulk write/read command
    ///     family extension (`WriteBulk` / `Write2Bulk` / `WriteSecuredBulk` /
    ///     `WriteSecured2Bulk` / `ReadBulk` plus their `BulkWriteReply` and
    ///     `BulkReadReply` payloads) shipped under version 3 — both were strictly
    ///     additive contract changes, so neither required a further bump. A
    ///     future breaking contract change should bump this constant and update
    ///     this test in lock-step.
    /// </summary>
    [Fact]
    public void GatewayProtocolVersion_IsVersionThree()
    {
        Assert.Equal(3u, GatewayContractInfo.GatewayProtocolVersion);
    }

    /// <summary>Verifies that the worker protocol version starts at version one.</summary>
    [Fact]
    public void WorkerProtocolVersion_StartsAtVersionOne()
    {
        Assert.Equal(1u, GatewayContractInfo.WorkerProtocolVersion);
    }
}
