UnitTests du démon qui marchent pas (et du coup plus de test_requin tej) + le bouton avce le pllus et l'utilisateur en mieux man + diagrammes de classe plus classes + PS rien marche + double PS : 85 erreurs
parent
2fd4ed9c3a
commit
d0d1137a0d
File diff suppressed because it is too large
Load Diff
@ -1,14 +0,0 @@
|
||||
using System;
|
||||
using Xunit;
|
||||
|
||||
namespace TestsUnitaires
|
||||
{
|
||||
public class UnitTest1
|
||||
{
|
||||
[Fact]
|
||||
public void Test1()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.collector" Version="3.0.2">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Modèle\Modèle.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 17 KiB |
Loading…
Reference in new issue