using System.Reflection;
using Shouldly;
using ZB.MOM.NatsNet.Server;

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

public sealed class JetStreamClusterConsumersGroupATests
{
    [Fact] // T:1636
    public void ConsumerAssignmentOrInflight_Method_ShouldExist()
    {
        typeof(JetStreamEngine).GetMethod("ConsumerAssignmentOrInflight", BindingFlags.Instance | BindingFlags.NonPublic).ShouldNotBeNull();
    }

    [Fact] // T:1637
    public void ConsumerAssignmentsOrInflightSeq_Method_ShouldExist()
    {
        typeof(JetStreamEngine).GetMethod("ConsumerAssignmentsOrInflightSeq", BindingFlags.Instance | BindingFlags.NonPublic).ShouldNotBeNull();
    }

    [Fact] // T:1638
    public void ConsumerAssigned_Method_ShouldExist()
    {
        typeof(JsAccount).GetMethod("ConsumerAssigned", BindingFlags.Instance | BindingFlags.NonPublic).ShouldNotBeNull();
    }

    [Fact] // T:1639
    public void IsConsumerAssigned_Method_ShouldExist()
    {
        typeof(JetStreamCluster).GetMethod("IsConsumerAssigned", BindingFlags.Instance | BindingFlags.NonPublic).ShouldNotBeNull();
    }

    [Fact] // T:1640
    public void StreamAndNode_Method_ShouldExist()
    {
        typeof(NatsConsumer).GetMethod("StreamAndNode", BindingFlags.Instance | BindingFlags.NonPublic).ShouldNotBeNull();
    }

    [Fact] // T:1641
    public void Replica_Method_ShouldExist()
    {
        typeof(NatsConsumer).GetMethod("Replica", BindingFlags.Instance | BindingFlags.NonPublic).ShouldNotBeNull();
    }

    [Fact] // T:1642
    public void RaftGroup_Method_ShouldExist()
    {
        typeof(NatsConsumer).GetMethod("RaftGroup", BindingFlags.Instance | BindingFlags.NonPublic).ShouldNotBeNull();
    }

    [Fact] // T:1643
    public void ClearRaftNode_Method_ShouldExist()
    {
        typeof(NatsConsumer).GetMethod("ClearRaftNode", BindingFlags.Instance | BindingFlags.NonPublic).ShouldNotBeNull();
    }

    [Fact] // T:1644
    public void RaftNode_Method_ShouldExist()
    {
        typeof(NatsConsumer).GetMethod("RaftNode", BindingFlags.Instance | BindingFlags.NonPublic).ShouldNotBeNull();
    }

    [Fact] // T:1645
    public void MonitorConsumer_Method_ShouldExist()
    {
        typeof(JetStreamEngine).GetMethod("MonitorConsumer", BindingFlags.Instance | BindingFlags.NonPublic).ShouldNotBeNull();
    }

    [Fact] // T:1646
    public void ApplyConsumerEntries_Method_ShouldExist()
    {
        typeof(JetStreamEngine).GetMethod("ApplyConsumerEntries", BindingFlags.Instance | BindingFlags.NonPublic).ShouldNotBeNull();
    }

    [Fact] // T:1647
    public void ProcessReplicatedAck_Method_ShouldExist()
    {
        typeof(NatsConsumer).GetMethod("ProcessReplicatedAck", BindingFlags.Instance | BindingFlags.NonPublic).ShouldNotBeNull();
    }

    [Fact] // T:1648
    public void DecodeAckUpdate_Method_ShouldExist()
    {
        var method = typeof(JetStreamCluster).GetMethod("DecodeAckUpdate", BindingFlags.Static | BindingFlags.NonPublic);
        method.ShouldNotBeNull();
    }

    [Fact] // T:1649
    public void DecodeDeliveredUpdate_Method_ShouldExist()
    {
        typeof(JetStreamCluster).GetMethod("DecodeDeliveredUpdate", BindingFlags.Static | BindingFlags.NonPublic).ShouldNotBeNull();
    }

    [Fact] // T:1650
    public void ProcessConsumerLeaderChange_Method_ShouldExist()
    {
        typeof(JetStreamEngine).GetMethod("ProcessConsumerLeaderChange", BindingFlags.Instance | BindingFlags.NonPublic).ShouldNotBeNull();
    }

    [Fact] // T:1651
    public void ShouldSendLostQuorum_Method_ShouldExist()
    {
        typeof(NatsConsumer).GetMethod("ShouldSendLostQuorum", BindingFlags.Instance | BindingFlags.NonPublic).ShouldNotBeNull();
    }

    [Fact] // T:1652
    public void SendConsumerLostQuorumAdvisory_Method_ShouldExist()
    {
        typeof(NatsServer).GetMethod("SendConsumerLostQuorumAdvisory", BindingFlags.Instance | BindingFlags.NonPublic).ShouldNotBeNull();
    }

    [Fact] // T:1653
    public void SendConsumerLeaderElectAdvisory_Method_ShouldExist()
    {
        typeof(NatsServer).GetMethod("SendConsumerLeaderElectAdvisory", BindingFlags.Instance | BindingFlags.NonPublic).ShouldNotBeNull();
    }

    [Fact] // T:1654
    public void IsInsufficientResourcesErr_Method_ShouldExist()
    {
        typeof(JetStreamCluster).GetMethod("IsInsufficientResourcesErr", BindingFlags.Static | BindingFlags.NonPublic).ShouldNotBeNull();
    }

    [Fact] // T:1655
    public void ProcessStreamAssignmentResults_Method_ShouldExist()
    {
        typeof(JetStreamEngine).GetMethod("ProcessStreamAssignmentResults", BindingFlags.Instance | BindingFlags.NonPublic).ShouldNotBeNull();
    }
}
