
import pytest
from sut.backend.models.member import Member

@pytest.fixture
def member():
    member = Member()
    member.id = 3
    member.name = "Gimli"
    member.race = "Dwarf"
    member.role = "Companion"
    member.status = "active"
    member.description = "A brave dwarf."
    member.created_at = None
    return member

def test_to_dict_returns_expected_keys(member):
    # Arrange
    # (fixture)
    # Act
    result = member.to_dict()
    # Assert
    assert set(result.keys()) == {"id", "name", "race", "role", "status", "description", "created_at"}
    assert result["name"] == "Gimli"
    assert result["race"] == "Dwarf"

def test_repr_returns_expected(member):
    # Arrange
    # (fixture)
    # Act
    result = repr(member)
    # Assert
    assert "Gimli" in result
