using NATS.Server.JetStream.Cluster;

namespace NATS.Server.Tests;

public class JetStreamClusterGovernanceParityTests
{
    [Fact]
    public async Task Cluster_governance_applies_planned_replica_placement()
    {
        var planner = new AssetPlacementPlanner(nodes: 3);
        var placement = planner.PlanReplicas(replicas: 2);
        placement.Count.ShouldBe(2);

        var group = new StreamReplicaGroup("ORDERS", replicas: 1);
        await group.ApplyPlacementAsync(placement, default);
        group.Nodes.Count.ShouldBe(2);
    }
}
