using OF_DL.Models.Dtos.Users;
using OF_DL.Models.Entities.Users;
using OF_DL.Models.Mappers;

namespace OF_DL.Tests.Models.Mappers;

public class UserMapperTests
{
    [Fact]
    public void FromDto_ReturnsNull_WhenDtoNull() => Assert.Null(UserMapper.FromDto(null));

    [Fact]
    public void FromDto_MapsFields()
    {
        UserDto dto = new() { Avatar = "avatar", Header = "header", Name = "Name", Username = "user" };

        User? result = UserMapper.FromDto(dto);

        Assert.NotNull(result);
        Assert.Equal("avatar", result.Avatar);
        Assert.Equal("header", result.Header);
        Assert.Equal("Name", result.Name);
        Assert.Equal("user", result.Username);
    }
}
