diff --git a/LOLAPP/UniTestss/UniTestAbility.cs b/LOLAPP/UniTestss/UniTestAbility.cs deleted file mode 100644 index aadcffb..0000000 --- a/LOLAPP/UniTestss/UniTestAbility.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Models; - -namespace Tests -{ - public class AbilityTests - { - [Fact] - public void Ability_Constructor_SetsProperties() - { - // Arrange - string name = "Capacité 1"; - string image = "image1.png"; - string description = "Description de la capacité"; - - // Act - var ability = new Ability(name, image, description); - - // Assert - Assert.Equal(name, ability.Name); - Assert.Equal(image, ability.Image); - Assert.Equal(description, ability.Description); - } - } -} diff --git a/LOLAPP/UniTestss/UniTestChampions.cs b/LOLAPP/UniTestss/UniTestChampions.cs deleted file mode 100644 index ba2c146..0000000 --- a/LOLAPP/UniTestss/UniTestChampions.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Models; -using System.Collections.Generic; - -namespace Tests -{ - public class ChampionTests - { - [Fact] - public void Champion_ConstructorWithAbilities_SetsProperties() - { - // Arrange - string name = "Champion 1"; - string titre = "Titre du champion"; - string image = "image1.png"; - var abilities = new List() - { - new Ability("Capacité 1", "image1.png", "Description de la capacité 1"), - new Ability("Capacité 2", "image2.png", "Description de la capacité 2") - }; - - // Act - var champion = new Champion(name, titre, image, abilities); - - // Assert - Assert.Equal(name, champion.Name); - Assert.Equal(titre, champion.Titre); - Assert.Equal(image, champion.Image); - Assert.Equal(abilities, champion.Abilities); - } - - [Fact] - public void Champion_ConstructorWithoutAbilities_SetsProperties() - { - // Arrange - string name = "Champion 2"; - string titre = "Titre du champion"; - string image = "image2.png"; - - // Act - var champion = new Champion(name, titre, image); - - // Assert - Assert.Equal(name, champion.Name); - Assert.Equal(titre, champion.Titre); - Assert.Equal(image, champion.Image); - Assert.Empty(champion.Abilities); - } - } -} \ No newline at end of file diff --git a/LOLAPP/UniTestss/UniTestIPersistanceManager.cs b/LOLAPP/UniTestss/UniTestIPersistanceManager.cs deleted file mode 100644 index 56220ac..0000000 --- a/LOLAPP/UniTestss/UniTestIPersistanceManager.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Moq; -using Models; - -namespace Tests -{ - public class IPersistanceManagerTests - { - [Fact] - public void ChargeDonne_ReturnsExpectedData() - { - // Arrange - var mockPersistance = new Mock(); - var expectedChampions = new List - { - new Champion("Champion 1", "Titre 1", "Image 1"), - new Champion("Champion 2", "Titre 2", "Image 2"), - }; - var expectedUtilisateurs = new List - { - new Utilisateur("Utilisateur 1"), - new Utilisateur("Utilisateur 2"), - }; - mockPersistance.Setup(p => p.Chargdon()) - .Returns((expectedChampions, expectedUtilisateurs)); - var manager = new Manager(mockPersistance.Object); - - // Act - manager.Chargdon(); - - // Assert - Assert.Equal(expectedChampions, manager._champions); - Assert.Equal(expectedUtilisateurs, manager._utilisateur); - } - - [Fact] - public void Sauvdon_CallsPersistanceManagerSauvdonMethod() - { - // Arrange - var mockPersistance = new Mock(); - var manager = new Manager(mockPersistance.Object); - - // Act - manager.Sauvdon(); - - // Assert - mockPersistance.Verify(p => p.Sauvdon(manager._champions, manager._utilisateur), Times.Once); - } - } -} diff --git a/LOLAPP/UniTestss/UniTestStrategie.cs b/LOLAPP/UniTestss/UniTestStrategie.cs deleted file mode 100644 index e5af6c7..0000000 --- a/LOLAPP/UniTestss/UniTestStrategie.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Models; - -namespace Tests -{ - public class StrategieTests - { - [Fact] - public void CreerStrategie_AvecNomDescriptionEtChampions_Valide() - { - // Arrange - string nom = "Stratégie 1"; - string description = "Description de la stratégie"; - var champions = new List - { - new Champion("Champion 1", "Titre 1", "Image 1"), - new Champion("Champion 2", "Titre 2", "Image 2") - new Champion("Champion 3", "Titre 3", "Image 3") - new Champion("Champion 4", "Titre 4", "Image 4") - new Champion("Champion 5", "Titre 5", "Image 5") - }; - - // Act - var strategie = new Strategie(nom, description, champions); - - // Assert - Assert.Equal(nom, strategie.Name); - Assert.Equal(description, strategie.Description); - Assert.Equal(champions, strategie.Champions); - } - } -} diff --git a/LOLAPP/UniTestss/UniTestUtilisateur.cs b/LOLAPP/UniTestss/UniTestUtilisateur.cs deleted file mode 100644 index 99aa583..0000000 --- a/LOLAPP/UniTestss/UniTestUtilisateur.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Xunit; -using Moq; -using Models; - -namespace Tests -{ - public class IPersistanceManagerTests - { - [Fact] - public void ChargeDonne_ReturnsExpectedData() - { - // Arrange - var mockPersistance = new Mock(); - var expectedChampions = new List - { - new Champion("Champion 1", "Titre 1", "Image 1"), - new Champion("Champion 2", "Titre 2", "Image 2"), - }; - var expectedUtilisateurs = new List - { - new Utilisateur("Utilisateur 1"), - new Utilisateur("Utilisateur 2"), - }; - mockPersistance.Setup(p => p.Chargdon()) - .Returns((expectedChampions, expectedUtilisateurs)); - var manager = new Manager(mockPersistance.Object); - - // Act - manager.Chargdon(); - - // Assert - Assert.Equal(expectedChampions, manager._champions); - Assert.Equal(expectedUtilisateurs, manager._utilisateur); - } - - [Fact] - public void Sauvdon_CallsPersistanceManagerSauvdonMethod() - { - // Arrange - var mockPersistance = new Mock(); - var manager = new Manager(mockPersistance.Object); - - // Act - manager.Sauvdon(); - - // Assert - mockPersistance.Verify(p => p.Sauvdon(manager._champions, manager._utilisateur), Times.Once); - } - } -} diff --git a/LOLAPP/UniTestss/UniTests.csproj b/LOLAPP/UniTestss/UniTests.csproj deleted file mode 100644 index 020de70..0000000 --- a/LOLAPP/UniTestss/UniTests.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - - net7.0 - enable - enable - - false - true - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - diff --git a/LOLAPP/UniTestss/Usings.cs b/LOLAPP/UniTestss/Usings.cs deleted file mode 100644 index 8c927eb..0000000 --- a/LOLAPP/UniTestss/Usings.cs +++ /dev/null @@ -1 +0,0 @@ -global using Xunit; \ No newline at end of file