From 4d41996e8a5b4bee9e38d1a61ef535da1051d6bf Mon Sep 17 00:00:00 2001 From: "pauline.prady" Date: Fri, 3 May 2024 17:29:37 +0200 Subject: [PATCH] =?UTF-8?q?Modificaion=20incompl=C3=A8te?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/CoreLibrary/Plateau.cs | 10 +++++----- Sources/CoreLibrary/PlateauTailleCodeException.cs | 2 +- Sources/CoreLibrary/PlateauTailleGrilleException.cs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Sources/CoreLibrary/Plateau.cs b/Sources/CoreLibrary/Plateau.cs index b1c885f..900718e 100644 --- a/Sources/CoreLibrary/Plateau.cs +++ b/Sources/CoreLibrary/Plateau.cs @@ -20,9 +20,9 @@ throw new PlateauTailleCodeException(); } - if (tailleGrille != tailleCode) + if (tailleGrille <= 0) { - throw new PlateauTailleCodeException(); + throw new PlateauTailleGrilleException(); } codeSecret = new Code(tailleCode); @@ -51,14 +51,14 @@ public void AjouterCode(Code code) { - if (code.NbJetons < tailleCode) + if (code.TailleMaximale() != tailleCode) { - throw new PlateauTailleCodeIncompleteException(); + throw new CodeTailleMaximaleException(); } if (!code.EstComplet()) { - throw new PlateauCodeIncompletException(); + throw new CodeIncompletException(); } indicateurs[Tour - 1] = codeSecret.Comparer(code); diff --git a/Sources/CoreLibrary/PlateauTailleCodeException.cs b/Sources/CoreLibrary/PlateauTailleCodeException.cs index 45d3253..a73ed73 100644 --- a/Sources/CoreLibrary/PlateauTailleCodeException.cs +++ b/Sources/CoreLibrary/PlateauTailleCodeException.cs @@ -2,6 +2,6 @@ { public class PlateauTailleCodeException : Exception { - public PlateauTailleCodeException() : base("La taille du code doit être positif") { } + public PlateauTailleCodeException() : base("La taille du code doit être positive non nulle.") { } } } diff --git a/Sources/CoreLibrary/PlateauTailleGrilleException.cs b/Sources/CoreLibrary/PlateauTailleGrilleException.cs index 5d0bbfe..1305e65 100644 --- a/Sources/CoreLibrary/PlateauTailleGrilleException.cs +++ b/Sources/CoreLibrary/PlateauTailleGrilleException.cs @@ -2,7 +2,7 @@ { public class PlateauTailleGrilleException : Exception { - public PlateauTailleGrilleException() : base("La taille de la grille doit être égale à la taille du code") + public PlateauTailleGrilleException() : base("La taille de la grille doit être égale positive non nulle.") { } } }