using Microsoft.Extensions.DependencyInjection;
using NeonSprawl.Server.Game.Skills;
using Xunit;

namespace NeonSprawl.Server.Tests.Game.Skills;

public sealed class InMemoryPlayerSkillProgressionStoreTests
{
    [Fact]
    public void TrySetSkillXpTotal_WhenXpZeroAndSkillAbsent_ShouldReturnTrue()
    {
        // Arrange
        using var factory = new InMemoryWebApplicationFactory();
        var store = factory.Services.GetRequiredService<IPlayerSkillProgressionStore>();

        // Act
        var applied = store.TrySetSkillXpTotal("dev-local-1", "intrusion", xp: 0);

        // Assert
        Assert.True(applied);
        Assert.False(store.GetXpTotals("dev-local-1").ContainsKey("intrusion"));
    }
}
