import pytest

from src.items.legendary import LegendaryItem
from src.items.exceptions.invalid_quality_value import InvalidQualityValue

@pytest.fixture
def sulfuras():
    return LegendaryItem('Sulfuras', 10, 80)

def test_should_not_change_sell_in_when_updated(sulfuras):
    sulfuras.update_quality()
    assert sulfuras.get_sell_in() == 10

def test_should_not_change_quality_value_when_updated(sulfuras):
    sulfuras.update_quality()
    assert sulfuras.get_quality() == 80

def test_should_create_legendary_item_when_quality_value_is_greater_than_normal_items_maximum_value():
    LegendaryItem('Super Legendary Item', 10, 100)

def test_should_not_create_legendary_item_when_quality_value_is_less_than_minimum_value():
    with pytest.raises(InvalidQualityValue):
        LegendaryItem('Invalid Legendary Item', 2, -1)