using GmRelay.DiscordBot;

namespace GmRelay.Bot.Tests.Discord;

public sealed class DiscordOptionsTests
{
    [Theory]
    [InlineData(null)]
    [InlineData("")]
    [InlineData("   ")]
    public void Validate_ShouldRejectMissingToken(string? token)
    {
        var options = new DiscordOptions { Token = token };

        var exception = Assert.Throws<InvalidOperationException>(options.Validate);

        Assert.Contains("Discord:Token is required", exception.Message);
        Assert.Contains("Discord__Token", exception.Message);
    }

    [Fact]
    public void Validate_ShouldAcceptConfiguredToken()
    {
        var options = new DiscordOptions { Token = "configured-token" };

        options.Validate();
    }
}
