|
|
@ -17,8 +17,8 @@ namespace UnitTesting
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
|
public void TestConstructorInvalidArguments()
|
|
|
|
public void TestConstructorInvalidArguments()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Assert.Throws<ArgumentException>(() => new Code(0));
|
|
|
|
Assert.Throws<CodeTailleInvalideException>(() => new Code(0));
|
|
|
|
Assert.Throws<ArgumentException>(() => new Code(-1));
|
|
|
|
Assert.Throws<CodeTailleInvalideException>(() => new Code(-1));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
@ -35,7 +35,7 @@ namespace UnitTesting
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
|
public void TestSecondConstructorInvalidArguments()
|
|
|
|
public void TestSecondConstructorInvalidArguments()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Assert.Throws<ArgumentException>(() => new Code([]));
|
|
|
|
Assert.Throws<CodeTailleInvalideException>(() => new Code([]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
@ -67,9 +67,9 @@ namespace UnitTesting
|
|
|
|
public void TestSupprimerDernierJetonInvalid()
|
|
|
|
public void TestSupprimerDernierJetonInvalid()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Code code = new Code([]);
|
|
|
|
Code code = new Code([]);
|
|
|
|
Assert.Throws<Exception>(() => code.SupprimerDernierJeton());
|
|
|
|
Assert.Throws<CodeTableauLesJetonsVideException>(() => code.SupprimerDernierJeton());
|
|
|
|
Code code2 = new Code(4);
|
|
|
|
Code code2 = new Code(4);
|
|
|
|
Assert.Throws<Exception>(() => code2.SupprimerDernierJeton());
|
|
|
|
Assert.Throws<CodeTableauLesJetonsVideException>(() => code2.SupprimerDernierJeton());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
|