From a3161bd3e41dde2786b00f1596a602248c189907 Mon Sep 17 00:00:00 2001 From: "pauline.prady" Date: Fri, 7 Jun 2024 16:40:34 +0200 Subject: [PATCH] Documentation des exceptions --- Sources/UnitTesting/CodeCompletExceptionUT.cs | 29 +++++++++++---- .../UnitTesting/CodeIncompletExceptionUT.cs | 29 +++++++++++---- .../UnitTesting/CodeInvalideExceptionUT.cs | 36 ++++++++++++++----- Sources/UnitTesting/CodeVideExceptionUT.cs | 17 ++++++++- .../UnitTesting/GrilleCompleteExceptionUT.cs | 17 ++++++++- Sources/UnitTesting/IndiceCodeExceptionUT.cs | 20 ++++++++++- .../JoueurDejaPresentExceptionUT.cs | 17 ++++++++- .../NomJoueurInterditExceptionUT.cs | 17 ++++++++- Sources/UnitTesting/TailleCodeExceptionUT.cs | 18 ++++++++++ .../UnitTesting/TailleGrilleExceptionUT.cs | 36 ++++++++++++++----- 10 files changed, 199 insertions(+), 37 deletions(-) diff --git a/Sources/UnitTesting/CodeCompletExceptionUT.cs b/Sources/UnitTesting/CodeCompletExceptionUT.cs index 0ac5325..6388e59 100644 --- a/Sources/UnitTesting/CodeCompletExceptionUT.cs +++ b/Sources/UnitTesting/CodeCompletExceptionUT.cs @@ -7,14 +7,23 @@ using Xunit; namespace UnitTesting { + /// + /// Classe de test de l'exception CodeCompletException. + /// public class CodeCompletExceptionUT - { + { + /// + /// Test de l'exception CodeCompletException par defaut. + /// [Fact] public void ExceptionDefaut() { Assert.ThrowsAsync(() => throw new CodeCompletException()); - } - + } + + /// + /// Test du message de l'exception CodeCompletException. + /// [Fact] public void ExceptionMessage() { @@ -30,8 +39,11 @@ namespace UnitTesting { Assert.Equal(message, e.Message); } - } - + } + + /// + /// Test de l'exception CodeCompletException et de ses messages. + /// [Fact] public void ExceptionMessageEtException() { @@ -52,8 +64,11 @@ namespace UnitTesting Assert.IsType(e.InnerException); Assert.Equal(message2, e.InnerException.Message); } - } - + } + + /// + /// Test de la serialisation de l'exception CodeCompletException. + /// [Fact] public void ExceptionSerialisation() { diff --git a/Sources/UnitTesting/CodeIncompletExceptionUT.cs b/Sources/UnitTesting/CodeIncompletExceptionUT.cs index 0476bb1..a904f58 100644 --- a/Sources/UnitTesting/CodeIncompletExceptionUT.cs +++ b/Sources/UnitTesting/CodeIncompletExceptionUT.cs @@ -5,14 +5,23 @@ using Xunit; namespace UnitTesting { + /// + /// Classe de test de l'exception CodeIncompletException. + /// public class CodeIncompletExceptionUT - { + { + /// + /// Test de l'exception CodeIncompletException par defaut. + /// [Fact] public void ExceptionDefaut() { Assert.ThrowsAsync(() => throw new CodeIncompletException()); - } - + } + + /// + /// Test du message de l'exception CodeIncompletException. + /// [Fact] public void ExceptionMessage() { @@ -28,8 +37,11 @@ namespace UnitTesting { Assert.Equal(message, e.Message); } - } - + } + + /// + /// Test de l'exception CodeIncompletException et de ses messages. + /// [Fact] public void ExceptionMessageEtException() { @@ -50,8 +62,11 @@ namespace UnitTesting Assert.IsType(e.InnerException); Assert.Equal(message2, e.InnerException.Message); } - } - + } + + /// + /// Test de la serialisation de l'exception CodeIncompletException. + /// [Fact] public void ExceptionSerialisation() { diff --git a/Sources/UnitTesting/CodeInvalideExceptionUT.cs b/Sources/UnitTesting/CodeInvalideExceptionUT.cs index 87242c6..3d41ea8 100644 --- a/Sources/UnitTesting/CodeInvalideExceptionUT.cs +++ b/Sources/UnitTesting/CodeInvalideExceptionUT.cs @@ -5,14 +5,23 @@ using Xunit; namespace UnitTesting { + /// + /// Classe de test de l'exception CodeInvalideException. + /// public class CodeInvalideExceptionUT - { + { + /// + /// Test de l'exception CodeInvalideException par defaut. + /// [Fact] public void ExceptionDefaut() { Assert.ThrowsAsync(() => throw new CodeInvalideException()); - } - + } + + /// + /// Test des attributs de l'exception CodeInvalideException. + /// [Fact] public void ExceptionAttributs() { @@ -27,8 +36,11 @@ namespace UnitTesting Assert.Contains("3", e.Message); Assert.Contains("4", e.Message); } - } - + } + + /// + /// Test du message de l'exception CodeInvalideException. + /// [Fact] public void ExceptionMessage() { @@ -44,8 +56,11 @@ namespace UnitTesting { Assert.Equal(message, e.Message); } - } - + } + + /// + /// Test de l'exception CodeInvalideException et de ses messages. + /// [Fact] public void ExceptionMessageEtException() { @@ -66,8 +81,11 @@ namespace UnitTesting Assert.IsType(e.InnerException); Assert.Equal(message2, e.InnerException.Message); } - } - + } + + /// + /// Test de la serialisation de l'exception CodeInvalideException. + /// [Fact] public void ExceptionSerialisation() { diff --git a/Sources/UnitTesting/CodeVideExceptionUT.cs b/Sources/UnitTesting/CodeVideExceptionUT.cs index 2ad8544..a77dc77 100644 --- a/Sources/UnitTesting/CodeVideExceptionUT.cs +++ b/Sources/UnitTesting/CodeVideExceptionUT.cs @@ -4,15 +4,24 @@ using System.Runtime.Serialization; using Xunit; namespace UnitTesting -{ +{ + /// + /// Classe de test de l'exception CodeVideException. + /// public class CodeVideExceptionUT { + /// + /// Test de l'exception CodeVideException par defaut. + /// [Fact] public void ExceptionDefaut() { Assert.ThrowsAsync(() => throw new CodeVideException()); } + /// + /// Test du message de l'exception CodeVideException. + /// [Fact] public void ExceptionMessage() { @@ -30,6 +39,9 @@ namespace UnitTesting } } + /// + /// Test de l'exception CodeVideException et de ses messages. + /// [Fact] public void ExceptionMessageEtException() { @@ -52,6 +64,9 @@ namespace UnitTesting } } + /// + /// Test de la serialisation de l'exception CodeVideException. + /// [Fact] public void ExceptionSerialisation() { diff --git a/Sources/UnitTesting/GrilleCompleteExceptionUT.cs b/Sources/UnitTesting/GrilleCompleteExceptionUT.cs index c083a7d..bf4bf99 100644 --- a/Sources/UnitTesting/GrilleCompleteExceptionUT.cs +++ b/Sources/UnitTesting/GrilleCompleteExceptionUT.cs @@ -4,15 +4,24 @@ using System.Runtime.Serialization; using Xunit; namespace UnitTesting -{ +{ + /// + /// Classe de test de l'exception GrilleCompleteException. + /// public class GrilleCompleteExceptionUT { + /// + /// Test de l'exception GrilleCompleteException par defaut. + /// [Fact] public void ExceptionDefaut() { Assert.ThrowsAsync(() => throw new GrilleCompleteException()); } + /// + /// Test du message de l'exception GrilleCompleteException. + /// [Fact] public void ExceptionMessage() { @@ -30,6 +39,9 @@ namespace UnitTesting } } + /// + /// Test de l'exception GrilleCompleteException et de ses messages. + /// [Fact] public void ExceptionMessageEtException() { @@ -52,6 +64,9 @@ namespace UnitTesting } } + /// + /// Test de la serialisation de l'evenement GrilleCompleteException. + /// [Fact] public void ExceptionSerialisation() { diff --git a/Sources/UnitTesting/IndiceCodeExceptionUT.cs b/Sources/UnitTesting/IndiceCodeExceptionUT.cs index a14c524..d311d7f 100644 --- a/Sources/UnitTesting/IndiceCodeExceptionUT.cs +++ b/Sources/UnitTesting/IndiceCodeExceptionUT.cs @@ -4,15 +4,24 @@ using System.Runtime.Serialization; using Xunit; namespace UnitTesting -{ +{ + /// + /// Classe de test de l'exception IndiceCodeException. + /// public class IndiceCodeExceptionUT { + /// + /// Test de l'exception IndiceCodeException par defaut. + /// [Fact] public void ExceptionDefaut() { Assert.ThrowsAsync(() => throw new IndiceCodeException()); } + /// + /// Test des attributs de l'exception IndiceCodeException. + /// [Fact] public void ExceptionAttributs() { @@ -29,6 +38,9 @@ namespace UnitTesting } } + /// + /// Test du message de l'exception IndiceCodeException. + /// [Fact] public void ExceptionMessage() { @@ -46,6 +58,9 @@ namespace UnitTesting } } + /// + /// Test de l'exception IndiceCodeException et de ses messages. + /// [Fact] public void ExceptionMessageEtException() { @@ -68,6 +83,9 @@ namespace UnitTesting } } + /// + /// Test de la serialisation de l'evenement IndiceCodeException. + /// [Fact] public void ExceptionSerialisation() { diff --git a/Sources/UnitTesting/JoueurDejaPresentExceptionUT.cs b/Sources/UnitTesting/JoueurDejaPresentExceptionUT.cs index d6b3975..2246eb5 100644 --- a/Sources/UnitTesting/JoueurDejaPresentExceptionUT.cs +++ b/Sources/UnitTesting/JoueurDejaPresentExceptionUT.cs @@ -4,15 +4,24 @@ using System.Runtime.Serialization; using Xunit; namespace UnitTesting -{ +{ + /// + /// Classe de test de l'exception JoueurDejaPresentException. + /// public class JoueurDejaPresentExceptionUT { + /// + /// Test de l'exception JoueurDejaPresentException par defaut. + /// [Fact] public void ExceptionDefaut() { Assert.ThrowsAsync(() => throw new JoueurDejaPresentException()); } + /// + /// Test du message de l'exception JoueurDejaPresentException. + /// [Fact] public void ExceptionMessage() { @@ -30,6 +39,9 @@ namespace UnitTesting } } + /// + /// Test de l'exception JoueurDejaPresentException et ses messages. + /// [Fact] public void ExceptionMessageEtException() { @@ -52,6 +64,9 @@ namespace UnitTesting } } + /// + /// Test de la serilisation de l'exception JoueurDejaPresentException. + /// [Fact] public void ExceptionSerialisation() { diff --git a/Sources/UnitTesting/NomJoueurInterditExceptionUT.cs b/Sources/UnitTesting/NomJoueurInterditExceptionUT.cs index 6659841..37469ad 100644 --- a/Sources/UnitTesting/NomJoueurInterditExceptionUT.cs +++ b/Sources/UnitTesting/NomJoueurInterditExceptionUT.cs @@ -4,15 +4,24 @@ using System.Runtime.Serialization; using Xunit; namespace UnitTesting -{ +{ + /// + /// Classe de test pour l'exception NomJoueurInterditException. + /// public class NomJoueurInterditExceptionUT { + /// + /// Test de l'exception NomJoueurInterditException par defaut. + /// [Fact] public void ExceptionDefaut() { Assert.ThrowsAsync(() => throw new NomJoueurInterditException()); } + /// + /// Test du message de l'exception NomJoueurInterditException. + /// [Fact] public void ExceptionMessage() { @@ -30,6 +39,9 @@ namespace UnitTesting } } + /// + /// Test de l'exception NomJoueurInterditException et de ses messages. + /// [Fact] public void ExceptionMessageEtException() { @@ -52,6 +64,9 @@ namespace UnitTesting } } + /// + /// Test de la serilisation de l'exception NomJoueurInterditException. + /// [Fact] public void ExceptionSerialisation() { diff --git a/Sources/UnitTesting/TailleCodeExceptionUT.cs b/Sources/UnitTesting/TailleCodeExceptionUT.cs index 7c1bfbe..49db1b8 100644 --- a/Sources/UnitTesting/TailleCodeExceptionUT.cs +++ b/Sources/UnitTesting/TailleCodeExceptionUT.cs @@ -5,14 +5,23 @@ using Xunit; namespace UnitTesting { + /// + /// Classe de test de l'exception TailleCodeException. + /// public class TailleCodeExceptionUT { + /// + /// Test l'exception par defaut. + /// [Fact] public void ExceptionDefaut() { Assert.ThrowsAsync(() => throw new TailleCodeException()); } + /// + /// Test les attributs de l'exception. + /// [Fact] public void ExceptionAttributs() { @@ -28,6 +37,9 @@ namespace UnitTesting } } + /// + /// Test le message de l'exception TailleCodeException. + /// [Fact] public void ExceptionMessage() { @@ -45,6 +57,9 @@ namespace UnitTesting } } + /// + /// Test l'exception TailleCodeException et ses messages. + /// [Fact] public void ExceptionMessageEtException() { @@ -67,6 +82,9 @@ namespace UnitTesting } } + /// + /// Test la serialisation de l'exception TailleCodeException. + /// [Fact] public void ExceptionSerialisation() { diff --git a/Sources/UnitTesting/TailleGrilleExceptionUT.cs b/Sources/UnitTesting/TailleGrilleExceptionUT.cs index 7d4bf33..83b77fa 100644 --- a/Sources/UnitTesting/TailleGrilleExceptionUT.cs +++ b/Sources/UnitTesting/TailleGrilleExceptionUT.cs @@ -5,14 +5,23 @@ using Xunit; namespace UnitTesting { + /// + /// Classe de test de l'exception TailleGrille. + /// public class TailleGrilleExceptionUT - { + { + /// + /// Test l'exception par defaut. + /// [Fact] public void ExceptionDefaut() { Assert.ThrowsAsync(() => throw new TailleGrilleException()); - } - + } + + /// + /// Test l'exception avec ces attributs. + /// [Fact] public void ExceptionAttributs() { @@ -26,8 +35,11 @@ namespace UnitTesting { Assert.Contains("0", e.Message); } - } - + } + + /// + /// Test l'affichage du message de l'exception TailleGrilleException. + /// [Fact] public void ExceptionMessage() { @@ -43,8 +55,11 @@ namespace UnitTesting { Assert.Equal(message, e.Message); } - } - + } + + /// + /// Test l'exception TailleGrilleException et ses messages. + /// [Fact] public void ExceptionMessageEtException() { @@ -65,8 +80,11 @@ namespace UnitTesting Assert.IsType(e.InnerException); Assert.Equal(message2, e.InnerException.Message); } - } - + } + + /// + /// Test la serialisation de l'exception TailleGrilleException. + /// [Fact] public void ExceptionSerialisation() {