|
|
@ -9,9 +9,8 @@ namespace TestsUnitaires
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public class TestUnitBanque
|
|
|
|
public class TestUnitBanque
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
Compte tc = new("Livret A", 16956);
|
|
|
|
Banque test = new("BNP Paribas", "https://mabanque.bnpparibas/", "https://logos-marques.com/wp-content/uploads/2020/12/BNP-Paribas-logo.png");
|
|
|
|
Banque test = new("BNP Paribas", "https://mabanque.bnpparibas/", "https://logos-marques.com/wp-content/uploads/2020/12/BNP-Paribas-logo.png");
|
|
|
|
Banque test2 = new("BNP Paribas", "https://mabanque.bnpparibas/", "https://logos-marques.com/wp-content/uploads/2020/12/BNP-Paribas-logo.png", listeCompte);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
|
public void testConstructeur1()
|
|
|
|
public void testConstructeur1()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -25,20 +24,19 @@ namespace TestsUnitaires
|
|
|
|
public void testConstructeur2()
|
|
|
|
public void testConstructeur2()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
List<Compte> listeCompte = new();
|
|
|
|
List<Compte> listeCompte = new();
|
|
|
|
Compte tc = new("Livret A", 16956);
|
|
|
|
|
|
|
|
listeCompte.Add(tc);
|
|
|
|
listeCompte.Add(tc);
|
|
|
|
Assert.NotNull(test2);
|
|
|
|
Banque test2 = new("BNP Paribas", "https://mabanque.bnpparibas/", "https://logos-marques.com/wp-content/uploads/2020/12/BNP-Paribas-logo.png", listeCompte);
|
|
|
|
Assert.NotNull(test2.ListeDesComptes);
|
|
|
|
Assert.NotNull(test);
|
|
|
|
|
|
|
|
Assert.NotNull(test.ListeDesComptes);
|
|
|
|
Assert.Equal("BNP Paribas", test.Nom);
|
|
|
|
Assert.Equal("BNP Paribas", test.Nom);
|
|
|
|
Assert.NotEqual("https://mabanque.bnpparibas/", test2.Nom);
|
|
|
|
Assert.NotEqual("https://mabanque.bnpparibas/", test.Nom);
|
|
|
|
Assert.Equal("https://mabanque.bnpparibas/", test2.UrlSite);
|
|
|
|
Assert.Equal("https://mabanque.bnpparibas/", test.UrlSite);
|
|
|
|
Assert.Equal("https://logos-marques.com/wp-content/uploads/2020/12/BNP-Paribas-logo.png", test2.UrlLogo);
|
|
|
|
Assert.Equal("https://logos-marques.com/wp-content/uploads/2020/12/BNP-Paribas-logo.png", test.UrlLogo);
|
|
|
|
Assert.Contains(tc, test2.ListeDesComptes);
|
|
|
|
Assert.Contains(tc,test2.ListeDesComptes);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
|
public void testAjouterCompte()
|
|
|
|
public void testAjouterCompte()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Compte tc = new("Livret A", 16956);
|
|
|
|
|
|
|
|
Assert.NotNull(test.ListeDesComptes);
|
|
|
|
Assert.NotNull(test.ListeDesComptes);
|
|
|
|
test.AjouterCompte(tc);
|
|
|
|
test.AjouterCompte(tc);
|
|
|
|
Assert.Contains(tc, test.ListeDesComptes);
|
|
|
|
Assert.Contains(tc, test.ListeDesComptes);
|
|
|
@ -46,13 +44,29 @@ namespace TestsUnitaires
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
|
public void testSupprimerCompte()
|
|
|
|
public void testSupprimerCompte()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Compte tc = new("Livret A", 16956);
|
|
|
|
|
|
|
|
Assert.NotNull(test.ListeDesComptes);
|
|
|
|
Assert.NotNull(test.ListeDesComptes);
|
|
|
|
test.AjouterCompte(tc);
|
|
|
|
test.AjouterCompte(tc);
|
|
|
|
Assert.Contains(tc, test.ListeDesComptes);
|
|
|
|
Assert.Contains(tc, test.ListeDesComptes);
|
|
|
|
test.SupprimerCompte(tc);
|
|
|
|
test.SupprimerCompte(tc);
|
|
|
|
Assert.DoesNotContain(tc, test.ListeDesComptes);
|
|
|
|
Assert.DoesNotContain(tc, test.ListeDesComptes);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
|
|
|
public void testExisteCompte()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
List<Compte> listeCompte = new();
|
|
|
|
|
|
|
|
listeCompte.Add(tc);
|
|
|
|
|
|
|
|
Banque test2 = new("BNP Paribas", "https://mabanque.bnpparibas/", "https://logos-marques.com/wp-content/uploads/2020/12/BNP-Paribas-logo.png", listeCompte);
|
|
|
|
|
|
|
|
Assert.True(test2.ExisteCompte("Livret A"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
|
|
|
public void testReturnCompte()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
List<Compte> listeCompte = new();
|
|
|
|
|
|
|
|
listeCompte.Add(tc);
|
|
|
|
|
|
|
|
Banque test2 = new("BNP Paribas", "https://mabanque.bnpparibas/", "https://logos-marques.com/wp-content/uploads/2020/12/BNP-Paribas-logo.png", listeCompte);
|
|
|
|
|
|
|
|
Assert.True(test2.ExisteCompte("Livret A"));
|
|
|
|
|
|
|
|
Assert.Equal(tc, test2.ReturnCompte("Livret A"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|