using Xunit;
using IamService.Domain.AggregatesModel.UserAggregate;

namespace IamService.UnitTests.Domain;

/// <summary>
/// EN: Unit tests for UserStatus enumeration.
/// VI: Unit tests cho UserStatus enumeration.
/// </summary>
public class UserStatusTests
{
    [Fact]
    public void UserStatus_Active_ShouldHaveCorrectIdAndName()
    {
        // Assert
        Assert.Equal(1, UserStatus.Active.Id);
        Assert.Equal("Active", UserStatus.Active.Name);
    }

    [Fact]
    public void UserStatus_Locked_ShouldHaveCorrectIdAndName()
    {
        // Assert
        Assert.Equal(2, UserStatus.Locked.Id);
        Assert.Equal("Locked", UserStatus.Locked.Name);
    }

    [Fact]
    public void UserStatus_Disabled_ShouldHaveCorrectIdAndName()
    {
        // Assert
        Assert.Equal(3, UserStatus.Disabled.Id);
        Assert.Equal("Disabled", UserStatus.Disabled.Name);
    }

    [Fact]
    public void UserStatus_PendingVerification_ShouldHaveCorrectIdAndName()
    {
        // Assert
        Assert.Equal(4, UserStatus.PendingVerification.Id);
        Assert.Equal("PendingVerification", UserStatus.PendingVerification.Name);
    }

    [Fact]
    public void GetAll_ShouldReturnAllStatuses()
    {
        // Act
        var statuses = UserStatus.GetAll().ToList();

        // Assert
        Assert.Equal(4, statuses.Count);
        Assert.Contains(UserStatus.Active, statuses);
        Assert.Contains(UserStatus.Locked, statuses);
        Assert.Contains(UserStatus.Disabled, statuses);
        Assert.Contains(UserStatus.PendingVerification, statuses);
    }
}
