using StellaOps.Auth;
using Xunit;

namespace StellaOps.Configuration.Tests;

public class AuthorityTelemetryTests
{
    [Fact]
    public void ServiceName_AndNamespace_MatchExpectations()
    {
        Assert.Equal("stellaops-authority", AuthorityTelemetry.ServiceName);
        Assert.Equal("stellaops", AuthorityTelemetry.ServiceNamespace);
    }

    [Fact]
    public void BuildDefaultResourceAttributes_ContainsExpectedKeys()
    {
        var attributes = AuthorityTelemetry.BuildDefaultResourceAttributes();

        Assert.Equal("stellaops-authority", attributes["service.name"]);
        Assert.Equal("stellaops", attributes["service.namespace"]);
        Assert.False(string.IsNullOrWhiteSpace(attributes["service.version"]?.ToString()));
    }
}
