#
# Copyright (c) Daniel Sheffield 2023
#
# All rights reserved
#
# THIS SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY
from app.activities.Rating import Rating
from pytest import mark, fixture
from urwid import Text

@fixture
def rating() -> Rating:
    return Rating({
        'rating': Text(''),
        'spread': Text(''),
        'marker': Text(''),
    })

@mark.parametrize('_min',[
    1,
    3,
    None,
])
@mark.parametrize('_avg', [
    2,
    None,
])
@mark.parametrize('_max',[
    3,
    None,
])
@mark.parametrize('price',[
    4,
    11,
    15,
    None,
])
@mark.parametrize('quantity',[
    5,
    0,
    None,
])
@mark.parametrize('unit',[
    '',
])
def test_rating(rating: Rating, _avg, _min, _max, unit, price, quantity):
    rating.update_rating(_avg, _min, _max, 'kg', price=price, quantity=quantity)
