using Thalos.Domain.Contracts;
using Thalos.Domain.Decisions;

namespace Thalos.Domain.UnitTests;

public class IdentityTokenDecisionServiceTests
{
    [Fact]
    public void BuildIssuedTokenResponse_WhenTokenMissing_ReturnsFallbackShape()
    {
        var service = new IdentityTokenDecisionService();

        var response = service.BuildIssuedTokenResponse(new IdentityTokenData(null, null));

        Assert.Equal(string.Empty, response.Token);
        Assert.Equal(0, response.ExpiresInSeconds);
    }

    [Fact]
    public void BuildIssuedTokenResponse_WhenTokenExists_ReturnsIssuedToken()
    {
        var service = new IdentityTokenDecisionService();

        var response = service.BuildIssuedTokenResponse(new IdentityTokenData("token-123", 1800));

        Assert.Equal("token-123", response.Token);
        Assert.Equal(1800, response.ExpiresInSeconds);
    }
}
