You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
3.2 KiB
76 lines
3.2 KiB
using System;
|
|
using Xunit;
|
|
using Modèle;
|
|
using System.Collections.Generic;
|
|
|
|
namespace UnitTests
|
|
{
|
|
public class UnitTest_Modele
|
|
{
|
|
|
|
[Fact]
|
|
public void Test1()
|
|
{
|
|
|
|
List<Zone> zones = new List<Zone> { Zone.ATLANTIQUE, Zone.PACIFIQUE };
|
|
List<string> RandomFunFacts = new List<string> { "askip les requins c'est cool", "le requin mexicain possède un groin", "le requin scie est sympa comme tout il me coupe du bois l'hiver" };
|
|
Requin requin = new Requin("Bob", "leRequin", "Les requins c'est trop cool", "LaPhoto", "LaVidéo", "laPhoto", Conservation.EX, zones, "askip un requin c'est rigolo");
|
|
Requin requin2 = new Requin("nom", "nomSci", "des", "photo", "video", "photoCarte", Conservation.CR, zones, RandomFunFacts);
|
|
List<Requin> bdd = new List<Requin> { requin, requin2 };
|
|
|
|
Console.WriteLine("Test de la classe Requin!");
|
|
foreach (Zone zone in requin2.Repartition)
|
|
{
|
|
Console.WriteLine(zone);
|
|
}
|
|
}
|
|
|
|
|
|
[Fact]
|
|
public void Test2()
|
|
{
|
|
List<Zone> zones = new List<Zone> { Zone.ATLANTIQUE, Zone.PACIFIQUE };
|
|
List<string> RandomFunFacts = new List<string> { "askip les requins c'est cool", "le requin mexicain possède un groin", "le requin scie est sympa comme tout il me coupe du bois l'hiver" };
|
|
Requin requin = new Requin("Bob", "leRequin", "Les requins c'est trop cool", "LaPhoto", "LaVidéo", "laPhoto", Conservation.EX, zones, "askip un requin c'est rigolo");
|
|
Requin requin2 = new Requin("nom", "nomSci", "des", "photo", "video", "photoCarte", Conservation.CR, zones, RandomFunFacts);
|
|
List<Requin> bdd = new List<Requin> { requin, requin2 };
|
|
|
|
Console.WriteLine("Test Personnes :");
|
|
DateTime d = new DateTime(2020, 12, 12);
|
|
List<Requin> finie = new List<Requin>();
|
|
Utilisateur u1 = new Utilisateur("bobpoutou@yahoo.com", "vivepoutou");
|
|
Utilisateur u2 = new Utilisateur("jeancarotte@gamil.com", "miamlescarottes", 48);
|
|
Expert e1 = new Expert("AlexPert@gmail.com", "lesRequins", "Le Gros BG", d);
|
|
Expert e2 = new Expert("Blabla@gmail.com", "lesPoissons", "Le débutant");
|
|
u1.FaireUnSubmit("Bob", "leRequin", "Les requins c'est trop cool", "LaPhoto", "LaVidéo", "laPhoto", Conservation.EX, zones, "askip un requin c'est rigolo", bdd);
|
|
e1.ValiderSubmit(finie, bdd);
|
|
Console.WriteLine(u1);
|
|
Console.WriteLine(u2);
|
|
|
|
foreach (Requin r in bdd)
|
|
{
|
|
Console.WriteLine(r);
|
|
}
|
|
foreach (Requin r in finie)
|
|
{
|
|
Console.WriteLine(r);
|
|
}
|
|
|
|
finie.Clear();
|
|
finie.Add(requin);
|
|
Console.WriteLine(e1);
|
|
Console.WriteLine(e2);
|
|
|
|
List<Zone> z = new List<Zone>();
|
|
u1.FaireUnChangement(requin, "lalalilalou", "", "", "", Conservation.NE, z, "hahahahaha", bdd);
|
|
e1.ValiderUnChangement(finie, bdd);
|
|
foreach (Requin r in finie)
|
|
{
|
|
Console.WriteLine(r);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|