using NATS.Server.TestUtilities;

namespace NATS.Server.JetStream.Tests;

public class JetStreamStreamApiTests
{
    [Fact]
    public async Task Stream_create_and_info_roundtrip()
    {
        var create = await JetStreamApiFixture.RequestAsync("$JS.API.STREAM.CREATE.ORDERS", "{\"name\":\"ORDERS\",\"subjects\":[\"orders.*\"]}");
        create.Error.ShouldBeNull();

        var info = await JetStreamApiFixture.RequestAsync("$JS.API.STREAM.INFO.ORDERS", "{}");
        info.Error.ShouldBeNull();
        info.StreamInfo!.Config.Name.ShouldBe("ORDERS");
    }
}
