Ajout de 3 tests unitaires + Image par défaut + Début persistance
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
bec919bf99
commit
91d491216a
After Width: | Height: | Size: 2.8 KiB |
@ -1,19 +1,34 @@
|
|||||||
|
using Model;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Security.Cryptography.X509Certificates;
|
using System.Security.Cryptography.X509Certificates;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace TestProject1
|
namespace TestProject1
|
||||||
{
|
{
|
||||||
|
|
||||||
public class UnitTest1
|
public class UnitTest1
|
||||||
{
|
{
|
||||||
[Fact]
|
[Fact]
|
||||||
public void ParametreEstPositif()
|
public void Personnage_PrimeSuperieurOuEgalAZero_ReturnTrue()
|
||||||
{
|
{
|
||||||
|
Personnage test = new Personnage("Luffy", -100, "Luffy au Chapeau de Paille", 19, 1.74, "East Blue", "Monkey D. Luffy est...", "Le Roi des Pirates, ce sera moi !", "luffy.png");
|
||||||
|
bool resultat = (test.Prime >= 0);
|
||||||
|
Assert.True(resultat,"La prime doit avoir une valeur positive");
|
||||||
|
}
|
||||||
|
[Fact]
|
||||||
|
public void Constructeurs_ImageEgaleValeurParDefaut_ReturnTrue()
|
||||||
|
{
|
||||||
|
Bestiaire test = new Bestiaire("Humains", "??", "Les humains sont ...", "Ils possèdent les caractéristiques suivantes ...");
|
||||||
|
bool resultat = (test.Image == "baseimage.png");
|
||||||
|
Assert.True(resultat,"L'image devrait avoir la valeur : baseImage.pnt");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Equipage_PremierChapEtPremierEpSuperieurOuEgalAZero_ReturnTrue()
|
||||||
|
{
|
||||||
|
Equipage test = new Equipage("Équipage du Roux", "Akagami Kalzokudan", "East Blue", -1, 0, true, "L'équipage du Roux ...", "roux.png");
|
||||||
|
bool resultat = (test.PremierChap >= 0 && test.PremierEp >= 0);
|
||||||
|
Assert.True(resultat, "Les paramètre PremierChap et PremierEp doivent être supérieur ou égale à 0");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1 +1,3 @@
|
|||||||
global using Xunit;
|
global using Xunit;
|
||||||
|
using TestProject1;
|
||||||
|
|
||||||
|
Loading…
Reference in new issue