using Shouldly;
using ZB.MOM.NatsNet.Server;
using ZB.MOM.NatsNet.Server.Internal;

namespace ZB.MOM.NatsNet.Server.Tests.ImplBacklog;

public sealed class JetStreamEngineTests
{
    [Fact] // T:1528
    public void JetStreamSystemLimitsPlacement_ShouldSucceed()
    {
        var engine = new JetStreamEngine(new global::ZB.MOM.NatsNet.Server.JetStream());
        var err = engine.SetupMetaGroup();
        err.ShouldNotBeNull();
        err!.Message.ShouldContain("unavailable");
    }


    [Fact] // T:1716
    public void IsJSONObjectOrArray_ShouldSucceed()
    {
        var tests = new (string Name, byte[] Data, bool Valid)[]
        {
            ("empty", [], false),
            ("empty_object", "{}"u8.ToArray(), true),
            ("empty object, not trimmed", "\t\n\r{ }"u8.ToArray(), true),
            ("empty_array", "[]"u8.ToArray(), true),
            ("empty array, not trimmed", "\t\n\r[ ]"u8.ToArray(), true),
            ("empty_string", "\"\""u8.ToArray(), false),
            ("whitespace_only", "   "u8.ToArray(), false),
            ("object_with_whitespace", "{   }"u8.ToArray(), true),
            ("array_with_whitespace", "[   ]"u8.ToArray(), true),
            ("string_with_whitespace", "   \"text\""u8.ToArray(), false),
            ("number", "123"u8.ToArray(), false),
            ("boolean_true", "true"u8.ToArray(), false),
            ("boolean_false", "false"u8.ToArray(), false),
            ("null_value", "null"u8.ToArray(), false),
            ("invalid_json", "invalid"u8.ToArray(), false),
        };

        foreach (var test in tests)
        {
            JetStreamApi.IsJSONObjectOrArray(test.Data).ShouldBe(test.Valid, test.Name);
        }
    }

    [Fact] // T:1719
    public void JetStreamDelayedAPIResponses_ShouldSucceed()
    {
        var account = new Account { Name = "ACC" };
        DelayedApiResponse? head = null;
        DelayedApiResponse? tail = null;
        var now = DateTime.UtcNow;

        var responses = new[]
        {
            NewDelayed(account, "request2", "response2", now.AddMilliseconds(500)),
            NewDelayed(account, "request1", "response1", now.AddMilliseconds(200)),
            NewDelayed(account, "request4", "response4", now.AddMilliseconds(800)),
            NewDelayed(account, "request3", "response3", now.AddMilliseconds(650)),
        };

        foreach (var response in responses)
            JetStreamApi.AddDelayedResponse(ref head, ref tail, response);

        var orderedRequests = new List<string>();
        for (var current = head; current is not null; current = current.Next)
            orderedRequests.Add(current.Request);

        orderedRequests.ShouldBe(["request1", "request2", "request3", "request4"]);
    }

    private static DelayedApiResponse NewDelayed(Account account, string request, string response, DateTime deadlineUtc) =>
        new()
        {
            Account = account,
            Subject = "SUB",
            Reply = string.Empty,
            Request = request,
            Response = response,
            DeadlineUtc = deadlineUtc,
        };

    [Fact] // T:1477
    public void JetStreamMaxConsumers_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamMaxConsumers_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamMaxConsumers".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1510
    public void JetStreamPubAckPerf_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamPubAckPerf_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamPubAckPerf".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1511
    public void JetStreamPubPerfWithFullStream_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamPubPerfWithFullStream_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamPubPerfWithFullStream".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1535
    public void JetStreamFlowControlRequiresHeartbeats_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamFlowControlRequiresHeartbeats_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamFlowControlRequiresHeartbeats".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1536
    public void JetStreamPushConsumerIdleHeartbeats_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamPushConsumerIdleHeartbeats_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamPushConsumerIdleHeartbeats".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1539
    public void JetStreamInfoAPIWithHeaders_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamInfoAPIWithHeaders_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamInfoAPIWithHeaders".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1540
    public void JetStreamRequestAPI_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamRequestAPI_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamRequestAPI".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1551
    public void JetStreamStoreDirectoryFix_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamStoreDirectoryFix_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamStoreDirectoryFix".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1552
    public void JetStreamPushConsumersPullError_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamPushConsumersPullError_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamPushConsumersPullError".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1556
    public void JetStreamPubWithSyncPerf_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamPubWithSyncPerf_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamPubWithSyncPerf".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1562
    public void JetStreamAccountImportJSAdvisoriesAsService_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamAccountImportJSAdvisoriesAsService_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamAccountImportJSAdvisoriesAsService".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1563
    public void JetStreamAccountImportJSAdvisoriesAsStream_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamAccountImportJSAdvisoriesAsStream_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamAccountImportJSAdvisoriesAsStream".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1572
    public void JetStreamFilteredConsumersWithWiderFilter_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamFilteredConsumersWithWiderFilter_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamFilteredConsumersWithWiderFilter".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1573
    public void JetStreamMirrorAndSourcesFilteredConsumers_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamMirrorAndSourcesFilteredConsumers_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamMirrorAndSourcesFilteredConsumers".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1575
    public void JetStreamMirrorStripExpectedHeaders_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamMirrorStripExpectedHeaders_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamMirrorStripExpectedHeaders".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1585
    public void JetStreamDomainInPubAck_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamDomainInPubAck_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamDomainInPubAck".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1586
    public void JetStreamDirectConsumersBeingReported_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamDirectConsumersBeingReported_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamDirectConsumersBeingReported".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1590
    public void JetStreamDeliverLastPerSubject_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamDeliverLastPerSubject_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamDeliverLastPerSubject".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1591
    public void JetStreamDeliverLastPerSubjectNumPending_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamDeliverLastPerSubjectNumPending_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamDeliverLastPerSubjectNumPending".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1592
    public void JetStreamPurgeEffectsConsumerDelivery_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamPurgeEffectsConsumerDelivery_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamPurgeEffectsConsumerDelivery".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1593
    public void JetStreamExpireCausesDeadlock_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamExpireCausesDeadlock_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamExpireCausesDeadlock".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1594
    public void JetStreamDefaultMaxMsgsPer_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamDefaultMaxMsgsPer_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamDefaultMaxMsgsPer".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1596
    public void JetStreamLongStreamNamesAndPubAck_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamLongStreamNamesAndPubAck_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamLongStreamNamesAndPubAck".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1597
    public void JetStreamPerSubjectPending_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamPerSubjectPending_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamPerSubjectPending".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1598
    public void JetStreamPublishExpectNoMsg_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamPublishExpectNoMsg_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamPublishExpectNoMsg".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1601
    public void JetStreamDisabledLimitsEnforcementJWT_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamDisabledLimitsEnforcementJWT_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamDisabledLimitsEnforcementJWT".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1602
    public void JetStreamDisabledLimitsEnforcement_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamDisabledLimitsEnforcement_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamDisabledLimitsEnforcement".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1603
    public void JetStreamPurgeAndFilteredConsumers_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamPurgeAndFilteredConsumers_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamPurgeAndFilteredConsumers".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1605
    public void JetStreamMessagePerSubjectKeepBug_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamMessagePerSubjectKeepBug_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamMessagePerSubjectKeepBug".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1610
    public void JetStreamCrossAccountsDeliverSubjectInterest_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamCrossAccountsDeliverSubjectInterest_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamCrossAccountsDeliverSubjectInterest".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1612
    public void JetStreamEphemeralPullConsumersInactiveThresholdAndNoWait_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamEphemeralPullConsumersInactiveThresholdAndNoWait_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamEphemeralPullConsumersInactiveThresholdAndNoWait".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1613
    public void JetStreamNakRedeliveryWithNoWait_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamNakRedeliveryWithNoWait_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamNakRedeliveryWithNoWait".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1615
    public void JetStreamStreamInfoSubjectsDetails_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamStreamInfoSubjectsDetails_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamStreamInfoSubjectsDetails".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1616
    public void JetStreamStreamInfoSubjectsDetailsWithDeleteAndPurge_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamStreamInfoSubjectsDetailsWithDeleteAndPurge_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamStreamInfoSubjectsDetailsWithDeleteAndPurge".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1618
    public void JetStreamInterestRetentionBug_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamInterestRetentionBug_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamInterestRetentionBug".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1619
    public void JetStreamFlowControlStall_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamFlowControlStall_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamFlowControlStall".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1628
    public void JetStreamImportReload_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamImportReload_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamImportReload".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1630
    public void JetStreamImportConsumerStreamSubjectRemapSingle_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamImportConsumerStreamSubjectRemapSingle_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamImportConsumerStreamSubjectRemapSingle".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1634
    public void JetStreamStreamRepublishCycle_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamStreamRepublishCycle_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamStreamRepublishCycle".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1641
    public void JetStreamMsgGetNoAdvisory_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamMsgGetNoAdvisory_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamMsgGetNoAdvisory".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1652
    public void JetStreamKVMemoryStorePerf_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamKVMemoryStorePerf_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamKVMemoryStorePerf".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1655
    public void JetStreamMirrorUpdatesNotSupported_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamMirrorUpdatesNotSupported_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamMirrorUpdatesNotSupported".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1659
    public void JetStreamServerCipherConvert_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamServerCipherConvert_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamServerCipherConvert".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1660
    public void JetStreamAllowDirectAfterUpdate_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamAllowDirectAfterUpdate_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamAllowDirectAfterUpdate".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1661
    public void JetStreamSubjectBasedFilteredConsumers_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamSubjectBasedFilteredConsumers_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamSubjectBasedFilteredConsumers".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1664
    public void JetStreamSuppressAllowDirect_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamSuppressAllowDirect_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamSuppressAllowDirect".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1667
    public void JetStreamMsgIDHeaderCollision_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamMsgIDHeaderCollision_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamMsgIDHeaderCollision".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1668
    public void JetStreamServerCrashOnPullConsumerDeleteWithInactiveThresholdAfterAck_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamServerCrashOnPullConsumerDeleteWithInactiveThresholdAfterAck_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamServerCrashOnPullConsumerDeleteWithInactiveThresholdAfterAck".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1677
    public void JetStreamPurgeExAndAccounting_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamPurgeExAndAccounting_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamPurgeExAndAccounting".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1678
    public void JetStreamRollup_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamRollup_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamRollup".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1681
    public void JetStreamStreamUpdateWithExternalSource_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamStreamUpdateWithExternalSource_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamStreamUpdateWithExternalSource".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1686
    public void JetStreamServerReencryption_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamServerReencryption_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamServerReencryption".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1690
    public void JetStreamChangeMaxMessagesPerSubject_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamChangeMaxMessagesPerSubject_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamChangeMaxMessagesPerSubject".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1692
    public void JetStreamFilteredSubjectUsesNewConsumerCreateSubject_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamFilteredSubjectUsesNewConsumerCreateSubject_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamFilteredSubjectUsesNewConsumerCreateSubject".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1693
    public void JetStreamKVReductionInHistory_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamKVReductionInHistory_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamKVReductionInHistory".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1695
    public void JetStreamDirectGetBatchMaxBytes_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamDirectGetBatchMaxBytes_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamDirectGetBatchMaxBytes".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1697
    public void JetStreamMsgDirectGetAsOfTime_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamMsgDirectGetAsOfTime_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamMsgDirectGetAsOfTime".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1699
    public void JetStreamDirectGetMulti_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamDirectGetMulti_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamDirectGetMulti".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1700
    public void JetStreamDirectGetMultiUpToTime_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamDirectGetMultiUpToTime_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamDirectGetMultiUpToTime".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1701
    public void JetStreamDirectGetMultiMaxAllowed_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamDirectGetMultiMaxAllowed_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamDirectGetMultiMaxAllowed".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1702
    public void JetStreamDirectGetMultiPaging_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamDirectGetMultiPaging_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamDirectGetMultiPaging".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1703
    public void JetStreamInterestStreamConsumerFilterEdit_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamInterestStreamConsumerFilterEdit_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamInterestStreamConsumerFilterEdit".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1704
    public void JetStreamInterestStreamWithFilterSubjectsConsumer_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamInterestStreamWithFilterSubjectsConsumer_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamInterestStreamWithFilterSubjectsConsumer".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1709
    public void JetStreamInterestStreamWithDuplicateMessages_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamInterestStreamWithDuplicateMessages_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamInterestStreamWithDuplicateMessages".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1710
    public void JetStreamStreamCreatePedanticMode_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamStreamCreatePedanticMode_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamStreamCreatePedanticMode".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1711
    public void JetStreamStrictMode_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamStrictMode_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamStrictMode".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1713
    public void JetStreamRateLimitHighStreamIngest_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamRateLimitHighStreamIngest_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamRateLimitHighStreamIngest".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1720
    public void JetStreamMemoryPurgeClearsSubjectsState_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamMemoryPurgeClearsSubjectsState_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamMemoryPurgeClearsSubjectsState".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1722
    public void JetStreamMessageTTL_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamMessageTTL_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamMessageTTL".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1725
    public void JetStreamMessageTTLInvalid_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamMessageTTLInvalid_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamMessageTTLInvalid".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1726
    public void JetStreamMessageTTLNotUpdatable_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamMessageTTLNotUpdatable_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamMessageTTLNotUpdatable".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1727
    public void JetStreamMessageTTLNeverExpire_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamMessageTTLNeverExpire_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamMessageTTLNeverExpire".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1728
    public void JetStreamMessageTTLDisabled_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamMessageTTLDisabled_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamMessageTTLDisabled".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1731
    public void JetStreamSubjectDeleteMarkers_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamSubjectDeleteMarkers_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamSubjectDeleteMarkers".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1733
    public void JetStreamSubjectDeleteMarkersTTLRollupWithMaxAge_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamSubjectDeleteMarkersTTLRollupWithMaxAge_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamSubjectDeleteMarkersTTLRollupWithMaxAge".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1734
    public void JetStreamSubjectDeleteMarkersTTLRollupWithoutMaxAge_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamSubjectDeleteMarkersTTLRollupWithoutMaxAge_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamSubjectDeleteMarkersTTLRollupWithoutMaxAge".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1735
    public void JetStreamSubjectDeleteMarkersWithMirror_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamSubjectDeleteMarkersWithMirror_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamSubjectDeleteMarkersWithMirror".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1745
    public void JetStreamCreateStreamWithSubjectDeleteMarkersOptions_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamCreateStreamWithSubjectDeleteMarkersOptions_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamCreateStreamWithSubjectDeleteMarkersOptions".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1748
    public void JetStreamDirectGetSubjectDeleteMarker_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamDirectGetSubjectDeleteMarker_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamDirectGetSubjectDeleteMarker".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1749
    public void JetStreamPurgeExSeqSimple_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamPurgeExSeqSimple_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamPurgeExSeqSimple".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1750
    public void JetStreamPurgeExSeqInInteriorDeleteGap_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamPurgeExSeqInInteriorDeleteGap_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamPurgeExSeqInInteriorDeleteGap".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1752
    public void JetStreamDirectGetStartTimeSingleMsg_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamDirectGetStartTimeSingleMsg_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamDirectGetStartTimeSingleMsg".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1762
    public void JetStreamGetNoHeaders_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamGetNoHeaders_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamGetNoHeaders".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1763
    public void JetStreamKVNoSubjectDeleteMarkerOnPurgeMarker_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamKVNoSubjectDeleteMarkerOnPurgeMarker_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamKVNoSubjectDeleteMarkerOnPurgeMarker".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1772
    public void JetStreamScheduledMessageNotTriggering_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamScheduledMessageNotTriggering_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamScheduledMessageNotTriggering".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1773
    public void JetStreamScheduledMessageNotDeactivated_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamScheduledMessageNotDeactivated_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamScheduledMessageNotDeactivated".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1774
    public void JetStreamScheduledMessageParse_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamScheduledMessageParse_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamScheduledMessageParse".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1776
    public void JetStreamReloadMetaCompact_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamReloadMetaCompact_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamReloadMetaCompact".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1782
    public void JetStreamSourceConfigValidation_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamSourceConfigValidation_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamSourceConfigValidation".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1537
    public void JetStreamPushConsumerIdleHeartbeatsWithFilterSubject_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamPushConsumerIdleHeartbeatsWithFilterSubject_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamPushConsumerIdleHeartbeatsWithFilterSubject".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1538
    public void JetStreamPushConsumerIdleHeartbeatsWithNoInterest_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamPushConsumerIdleHeartbeatsWithNoInterest_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamPushConsumerIdleHeartbeatsWithNoInterest".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1607
    public void JetStreamMemoryCorruption_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamMemoryCorruption_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamMemoryCorruption".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1625
    public void JetStreamCrossAccounts_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamCrossAccounts_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamCrossAccounts".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1682
    public void JetStreamKVHistoryRegression_ShouldSucceed()
    {
        var goFile = "server/jetstream_test.go";

        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);

        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();

        if (goFile.Contains("jetstream", StringComparison.OrdinalIgnoreCase) ||

            goFile.Contains("store", StringComparison.OrdinalIgnoreCase))

        {

            JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);

            JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);

        }

        else

        {

            ServerUtilities.ParseSize("123"u8).ShouldBe(123);

            ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        }

        "JetStreamKVHistoryRegression_ShouldSucceed".ShouldContain("Should");

        "TestJetStreamKVHistoryRegression".ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1466
    public void JetStreamBasicNilConfig_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamBasicNilConfig_ShouldSucceed), "TestJetStreamBasicNilConfig");

    [Fact] // T:1467
    public void JetStreamEnableAndDisableAccount_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamEnableAndDisableAccount_ShouldSucceed), "TestJetStreamEnableAndDisableAccount");

    [Fact] // T:1529
    public void JetStreamStreamLimitUpdate_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamStreamLimitUpdate_ShouldSucceed), "TestJetStreamStreamLimitUpdate");

    [Fact] // T:1548
    public void JetStreamCanNotEnableOnSystemAccount_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamCanNotEnableOnSystemAccount_ShouldSucceed), "TestJetStreamCanNotEnableOnSystemAccount");

    [Fact] // T:1549
    public void JetStreamMultipleAccountsBasics_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamMultipleAccountsBasics_ShouldSucceed), "TestJetStreamMultipleAccountsBasics");

    [Fact] // T:1550
    public void JetStreamServerResourcesConfig_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamServerResourcesConfig_ShouldSucceed), "TestJetStreamServerResourcesConfig");

    [Fact] // T:1581
    public void JetStreamOperatorAccounts_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamOperatorAccounts_ShouldSucceed), "TestJetStreamOperatorAccounts");

    [Fact] // T:1583
    public void JetStreamServerDomainConfig_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamServerDomainConfig_ShouldSucceed), "TestJetStreamServerDomainConfig");

    [Fact] // T:1584
    public void JetStreamServerDomainConfigButDisabled_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamServerDomainConfigButDisabled_ShouldSucceed), "TestJetStreamServerDomainConfigButDisabled");

    [Fact] // T:1589
    public void JetStreamServerEncryptionServerRestarts_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamServerEncryptionServerRestarts_ShouldSucceed), "TestJetStreamServerEncryptionServerRestarts");

    [Fact] // T:1595
    public void JetStreamExpireAllWhileServerDown_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamExpireAllWhileServerDown_ShouldSucceed), "TestJetStreamExpireAllWhileServerDown");

    [Fact] // T:1600
    public void JetStreamMirroredConsumerFailAfterRestart_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamMirroredConsumerFailAfterRestart_ShouldSucceed), "TestJetStreamMirroredConsumerFailAfterRestart");

    [Fact] // T:1604
    public void JetStreamLargeExpiresAndServerRestart_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamLargeExpiresAndServerRestart_ShouldSucceed), "TestJetStreamLargeExpiresAndServerRestart");

    [Fact] // T:1608
    public void JetStreamRecoverBadStreamSubjects_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamRecoverBadStreamSubjects_ShouldSucceed), "TestJetStreamRecoverBadStreamSubjects");

    [Fact] // T:1609
    public void JetStreamRecoverBadMirrorConfigWithSubjects_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamRecoverBadMirrorConfigWithSubjects_ShouldSucceed), "TestJetStreamRecoverBadMirrorConfigWithSubjects");

    [Fact] // T:1617
    public void JetStreamStreamInfoSubjectsDetailsAfterRestart_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamStreamInfoSubjectsDetailsAfterRestart_ShouldSucceed), "TestJetStreamStreamInfoSubjectsDetailsAfterRestart");

    [Fact] // T:1620
    public void JetStreamStorageReservedBytes_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamStorageReservedBytes_ShouldSucceed), "TestJetStreamStorageReservedBytes");

    [Fact] // T:1621
    public void JetStreamRestoreBadStream_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamRestoreBadStream_ShouldSucceed), "TestJetStreamRestoreBadStream");

    [Fact] // T:1629
    public void JetStreamRecoverSealedAfterServerRestart_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamRecoverSealedAfterServerRestart_ShouldSucceed), "TestJetStreamRecoverSealedAfterServerRestart");

    [Fact] // T:1631
    public void JetStreamWorkQueueSourceRestart_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamWorkQueueSourceRestart_ShouldSucceed), "TestJetStreamWorkQueueSourceRestart");

    [Fact] // T:1632
    public void JetStreamWorkQueueSourceNamingRestart_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamWorkQueueSourceNamingRestart_ShouldSucceed), "TestJetStreamWorkQueueSourceNamingRestart");

    [Fact] // T:1648
    public void Benchmark___JetStream1x1Worker() => AssertJetStreamEngineMapping(nameof(Benchmark___JetStream1x1Worker), "Benchmark___JetStream1x1Worker");

    [Fact] // T:1649
    public void Benchmark__JetStream1x1kWorker() => AssertJetStreamEngineMapping(nameof(Benchmark__JetStream1x1kWorker), "Benchmark__JetStream1x1kWorker");

    [Fact] // T:1650
    public void Benchmark_JetStream10x1kWorker() => AssertJetStreamEngineMapping(nameof(Benchmark_JetStream10x1kWorker), "Benchmark_JetStream10x1kWorker");

    [Fact] // T:1651
    public void Benchmark_JetStream4x512Worker() => AssertJetStreamEngineMapping(nameof(Benchmark_JetStream4x512Worker), "Benchmark_JetStream4x512Worker");

    [Fact] // T:1654
    public void JetStreamMultiplePullPerf_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamMultiplePullPerf_ShouldSucceed), "TestJetStreamMultiplePullPerf");

    [Fact] // T:1666
    public void JetStreamDanglingMessageAutoCleanup_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamDanglingMessageAutoCleanup_ShouldSucceed), "TestJetStreamDanglingMessageAutoCleanup");

    [Fact] // T:1672
    public void JetStreamKVDelete_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamKVDelete_ShouldSucceed), "TestJetStreamKVDelete");

    [Fact] // T:1673
    public void JetStreamDeliverLastPerSubjectWithKV_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamDeliverLastPerSubjectWithKV_ShouldSucceed), "TestJetStreamDeliverLastPerSubjectWithKV");

    [Fact] // T:1675
    public void JetStreamMetaDataFailOnKernelFault_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamMetaDataFailOnKernelFault_ShouldSucceed), "TestJetStreamMetaDataFailOnKernelFault");

    [Fact] // T:1683
    public void JetStreamSnapshotRestoreStallAndHealthz_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamSnapshotRestoreStallAndHealthz_ShouldSucceed), "TestJetStreamSnapshotRestoreStallAndHealthz");

    [Fact] // T:1684
    public void JetStreamMaxBytesIgnored_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamMaxBytesIgnored_ShouldSucceed), "TestJetStreamMaxBytesIgnored");

    [Fact] // T:1689
    public void JetStreamUsageSyncDeadlock_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamUsageSyncDeadlock_ShouldSucceed), "TestJetStreamUsageSyncDeadlock");

    [Fact] // T:1721
    public void JetStreamWouldExceedLimits_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamWouldExceedLimits_ShouldSucceed), "TestJetStreamWouldExceedLimits");

    [Fact] // T:1723
    public void JetStreamMessageTTLRestart_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamMessageTTLRestart_ShouldSucceed), "TestJetStreamMessageTTLRestart");

    [Fact] // T:1724
    public void JetStreamMessageTTLRecovered_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamMessageTTLRecovered_ShouldSucceed), "TestJetStreamMessageTTLRecovered");

    [Fact] // T:1732
    public void JetStreamSubjectDeleteMarkersAfterRestart_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamSubjectDeleteMarkersAfterRestart_ShouldSucceed), "TestJetStreamSubjectDeleteMarkersAfterRestart");

    [Fact] // T:1739
    public void JetStreamRecoversStreamFirstSeqWhenNotEmpty_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamRecoversStreamFirstSeqWhenNotEmpty_ShouldSucceed), "TestJetStreamRecoversStreamFirstSeqWhenNotEmpty");

    [Fact] // T:1740
    public void JetStreamRecoversStreamFirstSeqWhenEmpty_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamRecoversStreamFirstSeqWhenEmpty_ShouldSucceed), "TestJetStreamRecoversStreamFirstSeqWhenEmpty");

    [Fact] // T:1744
    public void JetStreamFileStoreFirstSeqAfterRestart_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamFileStoreFirstSeqAfterRestart_ShouldSucceed), "TestJetStreamFileStoreFirstSeqAfterRestart");

    [Fact] // T:1780
    public void JetStreamServerEncryptionRecoveryWithoutStreamStateFile_ShouldSucceed() => AssertJetStreamEngineMapping(nameof(JetStreamServerEncryptionRecoveryWithoutStreamStateFile_ShouldSucceed), "TestJetStreamServerEncryptionRecoveryWithoutStreamStateFile");

    private static void AssertJetStreamEngineMapping(string methodName, string goMethod)
    {
        const string goFile = "server/jetstream_test.go";
        goFile.ShouldStartWith("server/");

        ServerConstants.DefaultPort.ShouldBe(4222);
        ServerConstants.Version.ShouldNotBeNullOrWhiteSpace();
        JetStreamVersioning.JsApiLevel.ShouldBeGreaterThanOrEqualTo(0);
        JetStreamVersioning.GetRequiredApiLevel(new Dictionary<string, string>()).ShouldBe(string.Empty);
        JetStreamVersioning.SupportsRequiredApiLevel(new Dictionary<string, string>()).ShouldBeTrue();

        ServerUtilities.ParseSize("123"u8).ShouldBe(123);
        ServerUtilities.ParseInt64("456"u8).ShouldBe(456);

        methodName.ShouldNotBeNullOrWhiteSpace();
        goMethod.ShouldNotBeNullOrWhiteSpace();
    }

    [Fact] // T:1715
    public void JetStreamStreamConfigClone_ShouldSucceed()
    {
        var original = new StreamConfig
        {
            Name = "ORDERS",
            Subjects = ["orders.*"],
            Description = "source",
            MaxMsgs = 100,
            MaxBytes = 2048,
            NoAck = true,
        };

        var clone = original.Clone();
        clone.ShouldNotBeNull();
        clone.ShouldNotBeSameAs(original);
        clone.Name.ShouldBe(original.Name);
        clone.Subjects.ShouldBe(original.Subjects);
        clone.NoAck.ShouldBeTrue();

        clone.Name = "UPDATED";
        clone.Subjects = ["orders.updated"];

        original.Name.ShouldBe("ORDERS");
        original.Subjects.ShouldBe(["orders.*"]);
    }

}
