From f9f08a9f9f7fbf6638b6c23c6f7de345859be684 Mon Sep 17 00:00:00 2001 From: "yannis.doumir_fernandes" Date: Sun, 21 May 2023 15:22:15 +0200 Subject: [PATCH] correction test --- Sources/Persistance/LoaderXML.cs | 1 - Sources/Persistance/MonsterManager.cs | 2 +- Sources/Tests/Monstres_UT.cs | 16 ++++++++++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Sources/Persistance/LoaderXML.cs b/Sources/Persistance/LoaderXML.cs index d4d47a8..18f95b9 100644 --- a/Sources/Persistance/LoaderXML.cs +++ b/Sources/Persistance/LoaderXML.cs @@ -22,7 +22,6 @@ namespace Persistance public static void sauvegarderListUsers() { - throw new NotImplementedException(); } List IMonsterDataManager.loadMonsters() diff --git a/Sources/Persistance/MonsterManager.cs b/Sources/Persistance/MonsterManager.cs index f877c27..1c9df68 100644 --- a/Sources/Persistance/MonsterManager.cs +++ b/Sources/Persistance/MonsterManager.cs @@ -25,7 +25,7 @@ namespace Persistance } void IMonsterDataManager.saveMonsters(List monstres) { - + throw new NotImplementedException(); } List IMonsterDataManager.loadMonsters() diff --git a/Sources/Tests/Monstres_UT.cs b/Sources/Tests/Monstres_UT.cs index 8db9b52..44868d9 100644 --- a/Sources/Tests/Monstres_UT.cs +++ b/Sources/Tests/Monstres_UT.cs @@ -1,4 +1,5 @@ using Model; +using Modèle; namespace Tests @@ -7,20 +8,27 @@ namespace Tests { [Fact] public void TestFullConstructor() - { - Monstre a = new Monstre(0, "Name", "Hostility", "This is my description", new List { "Carac 1", "Carac 2", "Carac 3" }, new List { "App 1", "App 2", "App 3" }); + { + Monstre a = new Monstre(0, "Name", "Hostility", "This is my description", new List { "Carac 1", "Carac 2", "Carac 3" }, new List { "App 1", "App 2", "App 3" }, new List()); + User usetUT = new User("pseudo", "nom", "prenom", "mdp", new List()); + Conseil conseilUT = new Conseil(usetUT, "conseil de fou furieux", a); Assert.NotNull(a); Assert.Equal("Name", a.Name); Assert.Equal("Hostility", a.Dangerosite); Assert.Equal("This is my description", a.Description); Assert.Equal(new List { "Carac 1", "Carac 2", "Carac 3" }, a.CharacteristicsList); Assert.Equal(new List { "App 1", "App 2", "App 3" }, a.AppearanceList); + + } [Fact] public void TestVoidConstructor() - { - Assert.Throws(() => new Monstre(0, "", "", "", new List { "" }, new List { "" })); + { + Monstre a = new Monstre(0, "Name", "Hostility", "This is my description", new List { "Carac 1", "Carac 2", "Carac 3" }, new List { "App 1", "App 2", "App 3" }, new List()); + User usetUT = new User("pseudo", "nom", "prenom", "mdp", new List()); + Conseil conseilUT = new Conseil(usetUT, "conseil de fou furieux", a); + Assert.Throws(() => new Monstre(0, "", "", "", new List { "" }, new List { "" }, new List {conseilUT})); } } } \ No newline at end of file