using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Models.Game;

namespace Tests;

public class DiceTests
{
    [Fact]
    public void Constructor_WithNegativeNbMin_SetsNbMinToZero()
    {
        Dice dice = new Dice(-1);
        Assert.Equal(0, dice.NbMin);
    }

    [Fact]
    public void Constructor_WithNbMinGreaterThanOne_SetsNbMinToOne()
    {
        Dice dice = new Dice(2);
        Assert.Equal(1, dice.NbMin);
    }

    [Fact]
    public void Constructor_WithValidNbMin_SetsNbMinAndNbMaxCorrectly()
    {
        Dice dice = new Dice(1);
        Assert.Equal(1, dice.NbMin);
        Assert.Equal(6, dice.NbMax);
    }

    [Fact]
    public void DefaultConstructor_SetsNbMinToZeroAndNbMaxToFive()
    {
        Dice dice = new Dice();
        Assert.Equal(0, dice.NbMin);
        Assert.Equal(5, dice.NbMax);
    }

    [Fact]
    public void Roll_SetsValueBetweenNbMinAndNbMax()
    {
        Dice dice = new Dice();
        dice.Roll();
        Assert.True(dice.Value >= dice.NbMin && dice.Value <= dice.NbMax);
    }
}
