using NATS.Server.Protocol;

namespace NATS.Server.Tests;

public class MessageTraceInitializationTests
{
    [Fact]
    public void Trace_context_is_initialized_from_connect_options()
    {
        var connectOpts = new ClientOptions
        {
            Name = "c1",
            Lang = "dotnet",
            Version = "1.0.0",
            Headers = true,
        };

        var ctx = MessageTraceContext.CreateFromConnect(connectOpts);
        ctx.ClientName.ShouldBe("c1");
        ctx.ClientLang.ShouldBe("dotnet");
        ctx.ClientVersion.ShouldBe("1.0.0");
        ctx.HeadersEnabled.ShouldBeTrue();
    }
}
