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

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

public sealed class JetStreamClusterStreamsGroupBTests
{
    [Fact] // T:1598
    public void RecoveryKey_ConsumerAssignment_ShouldExist()
    {
        typeof(ConsumerAssignment).GetMethod("RecoveryKey", BindingFlags.Instance | BindingFlags.NonPublic).ShouldNotBeNull();
    }

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

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

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

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

    [Fact] // T:1603
    public void RaftGroup_NatsStream_ShouldExist()
    {
        typeof(NatsStream).GetMethod("RaftGroup", BindingFlags.Instance | BindingFlags.Public).ShouldNotBeNull();
    }

    [Fact] // T:1604
    public void RaftNode_NatsStream_ShouldExist()
    {
        typeof(NatsStream).GetMethod("RaftNode", BindingFlags.Instance | BindingFlags.Public).ShouldNotBeNull();
    }

    [Fact] // T:1605
    public void RemoveNode_NatsStream_ShouldExist()
    {
        typeof(NatsStream).GetMethod("RemoveNode", BindingFlags.Instance | BindingFlags.Public).ShouldNotBeNull();
    }

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

    [Fact] // T:1607
    public void WaitOnConsumerAssignments_NatsStream_ShouldExist()
    {
        typeof(NatsStream).GetMethod("WaitOnConsumerAssignments", BindingFlags.Instance | BindingFlags.Public).ShouldNotBeNull();
    }

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

    [Fact] // T:1609
    public void IsMigrating_NatsStream_ShouldExist()
    {
        typeof(NatsStream).GetMethod("IsMigrating", BindingFlags.Instance | BindingFlags.Public).ShouldNotBeNull();
    }

    [Fact] // T:1610
    public void ResetClusteredState_NatsStream_ShouldExist()
    {
        typeof(NatsStream).GetMethod("ResetClusteredState", BindingFlags.Instance | BindingFlags.Public).ShouldNotBeNull();
    }

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

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

    [Fact] // T:1613
    public void SkipBatchIfRecovering_NatsStream_ShouldExist()
    {
        typeof(NatsStream).GetMethod("SkipBatchIfRecovering", BindingFlags.Instance | BindingFlags.Public).ShouldNotBeNull();
    }

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

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

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

    [Fact] // T:1617
    public void ShouldSendLostQuorum_NatsStream_ShouldExist()
    {
        typeof(NatsStream).GetMethod("ShouldSendLostQuorum", BindingFlags.Instance | BindingFlags.Public).ShouldNotBeNull();
    }
}
