|
|
@ -21,6 +21,49 @@ namespace TestsUnitaires
|
|
|
|
Assert.Equal(1245.34, c2.Solde);
|
|
|
|
Assert.Equal(1245.34, c2.Solde);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
|
|
|
public void TestConstructeurCompte2()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
List<Operation> testlistope = new();
|
|
|
|
|
|
|
|
Operation testope = new("test", 20, DateTime.Now, MethodePayement.Cb);
|
|
|
|
|
|
|
|
testlistope.Add(testope);
|
|
|
|
|
|
|
|
Compte c1 = new("012345678901", "Livret A", 234,testlistope);
|
|
|
|
|
|
|
|
Compte c2 = new("012345678902", "&e23R_te7", 1245.34, testlistope);
|
|
|
|
|
|
|
|
Assert.Equal("Livret A", c1.Nom);
|
|
|
|
|
|
|
|
Assert.Equal("&e23R_te7", c2.Nom);
|
|
|
|
|
|
|
|
Assert.Equal(234, c1.Solde);
|
|
|
|
|
|
|
|
Assert.Equal(1245.34, c2.Solde);
|
|
|
|
|
|
|
|
Assert.NotNull(testlistope);
|
|
|
|
|
|
|
|
Assert.NotNull(testope);
|
|
|
|
|
|
|
|
Assert.True(c1.LesOpe.Count() == 1);
|
|
|
|
|
|
|
|
Assert.True(c2.LesOpe.Count() == 1);
|
|
|
|
|
|
|
|
c1.supprimerOperation(testope);
|
|
|
|
|
|
|
|
c2.supprimerOperation(testope);
|
|
|
|
|
|
|
|
Assert.True(c1.LesOpe.Count() == 0);
|
|
|
|
|
|
|
|
Assert.True(c2.LesOpe.Count() == 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
|
|
|
public void testAjouterOperation()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Compte c1 = new("012345678901", "Livret A", 234);
|
|
|
|
|
|
|
|
c1.ajouterOperation(new("test", 20, DateTime.Now, MethodePayement.Cb));
|
|
|
|
|
|
|
|
Assert.True(c1.LesOpe.Count() == 1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
|
|
|
public void testSupprimerOperation()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Compte c1 = new("012345678901", "Livret A", 234);
|
|
|
|
|
|
|
|
Operation testope = new("test", 20, DateTime.Now, MethodePayement.Cb);
|
|
|
|
|
|
|
|
c1.ajouterOperation(testope);
|
|
|
|
|
|
|
|
Assert.True(c1.LesOpe.Count() == 1);
|
|
|
|
|
|
|
|
c1.supprimerOperation(testope);
|
|
|
|
|
|
|
|
Assert.True(c1.LesOpe.Count() == 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
|
public void testSupprimerBanque()
|
|
|
|
public void testSupprimerBanque()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -33,5 +76,8 @@ namespace TestsUnitaires
|
|
|
|
Assert.DoesNotContain(bq, i1.LesBanques);
|
|
|
|
Assert.DoesNotContain(bq, i1.LesBanques);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|