You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Trek-12/source/Trek-12/Tests/DiceTest.cs

70 lines
1.4 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Models.Game;
namespace Tests;
public class DiceTest
{
[Fact]
public void TestConstructor()
{
Dice d = new Dice();
Assert.NotNull(d);
Assert.Equal(0, d.NbMin);
Assert.Equal(5, d.NbMax);
}
[Fact]
public void TestConstructorRebelotteWithInvalidNbMin()
{
Dice d = new Dice(2);
Assert.NotNull(d);
Assert.Equal(1, d.NbMin);
Assert.Equal(6, d.NbMax);
}
[Fact]
public void TestConstructorReRebelotteWithAnotherInvalidNbMin()
{
Dice d = new Dice(-2);
Assert.NotNull(d);
Assert.Equal(0, d.NbMin);
Assert.Equal(5, d.NbMax);
}
[Fact]
public void TestConstructorRebelotteWithValidNbMin()
{
Dice d = new Dice(1);
Assert.NotNull(d);
Assert.Equal(1, d.NbMin);
Assert.Equal(6, d.NbMax);
}
[Fact]
public void TestConstructorRebelotteWithAnotherValidNbMin()
{
Dice d = new Dice(0);
Assert.NotNull(d);
Assert.Equal(0, d.NbMin);
Assert.Equal(5, d.NbMax);
}
[Fact]
public void TestLancer()
{
Dice d = new Dice();
Assert.NotNull(d);
Assert.IsType<int>(d.Nb);
Assert.InRange(d.Nb, d.NbMin, d.NbMax);
}
}