diff --git a/Sources/CoreLibrary/Plateau.cs b/Sources/CoreLibrary/Plateau.cs index 3a78e43..b1c885f 100644 --- a/Sources/CoreLibrary/Plateau.cs +++ b/Sources/CoreLibrary/Plateau.cs @@ -51,7 +51,12 @@ public void AjouterCode(Code code) { - if (code.NbJetons < tailleCode || !code.EstComplet()) + if (code.NbJetons < tailleCode) + { + throw new PlateauTailleCodeIncompleteException(); + } + + if (!code.EstComplet()) { throw new PlateauCodeIncompletException(); } diff --git a/Sources/CoreLibrary/PlateauTailleCodeIncompleteException.cs b/Sources/CoreLibrary/PlateauTailleCodeIncompleteException.cs new file mode 100644 index 0000000..38133c7 --- /dev/null +++ b/Sources/CoreLibrary/PlateauTailleCodeIncompleteException.cs @@ -0,0 +1,7 @@ +namespace CoreLibrary +{ + public class PlateauTailleCodeIncompleteException : Exception + { + public PlateauTailleCodeIncompleteException() : base("Le code n'est pas remplit au maximum") { } + } +}