💚 MaJ CI
continuous-integration/drone/push Build is failing Details

pull/138/head
Hugo LIVET 2 years ago
parent 995a4b10ee
commit d3d1b57838

@ -13,6 +13,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Npgsql" Version="6.0.7" /> <PackageReference Include="Npgsql" Version="6.0.7" />
</ItemGroup> </ItemGroup>

@ -1,6 +1,4 @@
using Microsoft.Maui.Graphics; using System.ComponentModel;
using System.Collections.Specialized;
using System.ComponentModel;
namespace Model namespace Model
{ {

@ -12,4 +12,8 @@
<None Remove="Platforms\**" /> <None Remove="Platforms\**" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
</ItemGroup>
</Project> </Project>

@ -7,6 +7,10 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Data\Data_CI.csproj" /> <ProjectReference Include="..\Data\Data_CI.csproj" />
<ProjectReference Include="..\Modele\Model_CI.csproj" /> <ProjectReference Include="..\Modele\Model_CI.csproj" />

@ -25,7 +25,7 @@ namespace TestsUnitaires
public void testSupprimerBanque() public void testSupprimerBanque()
{ {
Banque bq = new Banque("Crédit Agricole", "https://creditagricole.fr", "https://yt3.ggpht.com/a/AGF-l7_mEfX2eQaGm8GefLOg5ZMRciNw-pESE3gUWg=s900-c-k-c0xffffffff-no-rj-mo"); Banque bq = new Banque("Crédit Agricole", "https://creditagricole.fr", "https://yt3.ggpht.com/a/AGF-l7_mEfX2eQaGm8GefLOg5ZMRciNw-pESE3gUWg=s900-c-k-c0xffffffff-no-rj-mo");
Inscrit i1 = new Inscrit("A1001", "Smith", "smith@gmail.com", "luke", "test20000aA", 500); Inscrit i1 = new Inscrit(1, "Smith", "smith@gmail.com", "luke", "test20000aA", 500);
Assert.NotNull(i1.LesBanques); Assert.NotNull(i1.LesBanques);
i1.ajouterBanque(bq); i1.ajouterBanque(bq);
Assert.Contains(bq, i1.LesBanques); Assert.Contains(bq, i1.LesBanques);

@ -12,9 +12,9 @@ namespace TestsUnitaires
[Fact] [Fact]
public void testCtorInscrit() public void testCtorInscrit()
{ {
Inscrit i = new Inscrit("I001", "LIVET", "Hugo.LIVET@etu.uca.fr", "Hugo", "Tu Sauras Passss:)1215", 2000); Inscrit i = new Inscrit(1, "LIVET", "Hugo.LIVET@etu.uca.fr", "Hugo", "Tu Sauras Passss:)1215", 2000);
Assert.NotNull(i); Assert.NotNull(i);
Assert.Equal("I001", i.Id); Assert.Equal(1, i.Id);
Assert.Equal("LIVET", i.Nom); Assert.Equal("LIVET", i.Nom);
Assert.Equal("Hugo.LIVET@etu.uca.fr", i.Mail); Assert.Equal("Hugo.LIVET@etu.uca.fr", i.Mail);
Assert.Equal("Hugo", i.Prenom); Assert.Equal("Hugo", i.Prenom);
@ -28,9 +28,9 @@ namespace TestsUnitaires
List<Banque> lesBanques = new List<Banque>(); List<Banque> lesBanques = new List<Banque>();
Banque b = new Banque("CA", "enavantouioui.fr", "NaN.fr"); Banque b = new Banque("CA", "enavantouioui.fr", "NaN.fr");
lesBanques.Add(b); lesBanques.Add(b);
Inscrit i = new Inscrit("I001", "LIVET", "Hugo.LIVET@etu.uca.fr", "Hugo", "Tu Sauras Passss:)1215", 2000, lesBanques); Inscrit i = new Inscrit(1, "LIVET", "Hugo.LIVET@etu.uca.fr", "Hugo", "Tu Sauras Passss:)1215", 2000, lesBanques);
Assert.NotNull(i); Assert.NotNull(i);
Assert.Equal("I001", i.Id); Assert.Equal(1, i.Id);
Assert.Equal("LIVET", i.Nom); Assert.Equal("LIVET", i.Nom);
Assert.Equal("Hugo.LIVET@etu.uca.fr", i.Mail); Assert.Equal("Hugo.LIVET@etu.uca.fr", i.Mail);
Assert.Equal("Hugo", i.Prenom); Assert.Equal("Hugo", i.Prenom);
@ -45,7 +45,7 @@ namespace TestsUnitaires
public void testAjoutBanqueInscrit() public void testAjoutBanqueInscrit()
{ {
Banque b = new Banque("CA", "enavantouioui.fr", "NaN.fr"); Banque b = new Banque("CA", "enavantouioui.fr", "NaN.fr");
Inscrit i = new Inscrit("I001", "LIVET", "Hugo.LIVET@etu.uca.fr", "Hugo", "Tu Sauras Passss:)1215", 2000); Inscrit i = new Inscrit(1, "LIVET", "Hugo.LIVET@etu.uca.fr", "Hugo", "Tu Sauras Passss:)1215", 2000);
i.ajouterBanque(b); i.ajouterBanque(b);
Assert.Contains(b, i.LesBanques); Assert.Contains(b, i.LesBanques);
} }
@ -54,7 +54,7 @@ namespace TestsUnitaires
public void testSupprimerBanqueInscrit() public void testSupprimerBanqueInscrit()
{ {
Banque b = new Banque("CA", "enavantouioui.fr", "NaN.fr"); Banque b = new Banque("CA", "enavantouioui.fr", "NaN.fr");
Inscrit i = new Inscrit("I001", "LIVET", "Hugo.LIVET@etu.uca.fr", "Hugo", "Tu Sauras Passss:)1215", 2000); Inscrit i = new Inscrit(1, "LIVET", "Hugo.LIVET@etu.uca.fr", "Hugo", "Tu Sauras Passss:)1215", 2000);
i.ajouterBanque(b); i.ajouterBanque(b);
i.SupprimerBanque(b); i.SupprimerBanque(b);
Assert.DoesNotContain(b, i.LesBanques); Assert.DoesNotContain(b, i.LesBanques);
@ -66,17 +66,17 @@ namespace TestsUnitaires
[Fact] [Fact]
public void testChoixDeviseInscrit() public void testChoixDeviseInscrit()
{ {
Inscrit i = new Inscrit("I001", "LIVET", "Hugo.LIVET@etu.uca.fr", "Hugo", "Tu Sauras Passss:)1215", 2000); Inscrit i = new Inscrit(1, "LIVET", "Hugo.LIVET@etu.uca.fr", "Hugo", "Tu Sauras Passss:)1215", 2000);
i.ChoisirDevise(Devises.Euro); i.ChoisirDevise(Devises.Euro);
Assert.Equal(Devises.Euro, i.Dev); Assert.Equal(Devises.Euro, i.Dev);
} }
[Theory] [Theory]
[InlineData("I000001", "LIVET", "a@a.fr", "Hugo", "123Soleil@azerty", 20000, true)]//OK [InlineData(1, "LIVET", "a@a.fr", "Hugo", "123Soleil@azerty", 20000, true)]//OK
[InlineData("I000002", "LIVET", "aa.fr", "Hugo", "123Soleil@azerty", 20000, false)]//Mail invalide psk pas de @ [InlineData(2, "LIVET", "aa.fr", "Hugo", "123Soleil@azerty", 20000, false)]//Mail invalide psk pas de @
[InlineData("I000003", "LIVET", "a@a.fr", "Hugo", "123soleil@azerty", 20000, false)]//mdp Invalide psk mdp sans Maj [InlineData(3, "LIVET", "a@a.fr", "Hugo", "123soleil@azerty", 20000, false)]//mdp Invalide psk mdp sans Maj
[InlineData("I000004", "LIVET", "a@a.fr", "Hugo", "Soleil@azerty", 20000, false)]//mdp Invalide psk pas de chiffres [InlineData(4, "LIVET", "a@a.fr", "Hugo", "Soleil@azerty", 20000, false)]//mdp Invalide psk pas de chiffres
public void CtorInscrit2TU(string id, string nom, string mail, string prenom, string mdp, double solde, bool notShouldThrowException) public void CtorInscrit2TU(int id, string nom, string mail, string prenom, string mdp, double solde, bool notShouldThrowException)
{ {
if (!notShouldThrowException) if (!notShouldThrowException)
{ {

@ -10,6 +10,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="xunit" Version="2.4.1" /> <PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"> <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

Loading…
Cancel
Save