merge xaml branch into master

pull/69/head
Antoine PEREDERII 2 years ago
commit b714623acd

@ -5,7 +5,7 @@ name: CI
trigger: trigger:
branch: branch:
- master - master
- C#/model - ci/*
event: event:
- push - push
@ -41,8 +41,8 @@ steps:
- dotnet sonarscanner begin /k:"Banquale" /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.login=$${PLUGIN_SONAR_TOKEN} - dotnet sonarscanner begin /k:"Banquale" /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.login=$${PLUGIN_SONAR_TOKEN}
- dotnet build Banquale.sln -c Release --no-restore - dotnet build Banquale.sln -c Release --no-restore
- dotnet test Banquale.sln --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage" - dotnet test Banquale.sln --logger trx --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --collect "XPlat Code Coverage"
# - reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport" - reportgenerator -reports:"**/coverage.cobertura.xml" -reporttypes:SonarQube -targetdir:"coveragereport"
# - dotnet publish Banquale/Banquale.csproj -c Release --no-restore -o $CI_PROJECT_DIR/build/release -f:net7.0-android /p:AndroidSdkDirectory=/usr/lib/android-sdk - dotnet publish Banquale/Banquale.csproj -c Release --no-restore -o $CI_PROJECT_DIR/build/release -f:net7.0-android /p:AndroidSdkDirectory=/usr/lib/android-sdk
- dotnet sonarscanner end /d:sonar.login=$${PLUGIN_SONAR_TOKEN} - dotnet sonarscanner end /d:sonar.login=$${PLUGIN_SONAR_TOKEN}
depends_on: [tests] depends_on: [tests]

@ -78,4 +78,4 @@ The application is functional but the color is not good and the design is not fi
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details. This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.
## Acknowledgments ## Acknowledgments
This project was inspired by our mobile bank app, the need for a modern and user-friendly mobile banking application. Special thanks to the .NET MAUI community for their contributions and support. This project was inspired by our mobile bank app, the need for a modern and user-friendly mobile banking application. Special thanks to the .NET MAUI community for their contributions and support and Clement Freville for his support.

@ -1,78 +1,78 @@
using System; //using System;
using Model; //using Model;
namespace UnitTest //namespace UnitTest
{ //{
/// \file // /// \file
/// \brief Fichier de tests pour la classe Customer. // /// \brief Fichier de tests pour la classe Customer.
/// \author Votre nom // /// \author Votre nom
/// <summary> // /// <summary>
/// Classe de tests pour la classe Customer. // /// Classe de tests pour la classe Customer.
/// </summary> // /// </summary>
public class CustomerTests // public class CustomerTests
{ // {
/// <summary> // /// <summary>
/// Teste si la liste des comptes du client est initialisée correctement. // /// Teste si la liste des comptes du client est initialisée correctement.
/// </summary> // /// </summary>
[Fact] // [Fact]
public void Constructor_AccountsListInitialized() // public void Constructor_AccountsListInitialized()
{ // {
// Arrange // // Arrange
string name = "Doe"; // string name = "Doe";
string firstName = "John"; // string firstName = "John";
string password = "123456"; // string password = "123456";
// Act // // Act
Customer customer = new Customer(name, firstName, password); // Customer customer = new Customer(name, firstName, password);
// Assert // // Assert
Assert.NotNull(customer.AccountsList); // Assert.NotNull(customer.AccountsList);
Assert.Empty(customer.AccountsList); // Assert.Empty(customer.AccountsList);
} // }
/// <summary> // /// <summary>
/// Teste l'égalité entre deux clients. // /// Teste l'égalité entre deux clients.
/// </summary> // /// </summary>
[Fact] // [Fact]
public void Equals_TwoEqualCustomers_ReturnsTrue() // public void Equals_TwoEqualCustomers_ReturnsTrue()
{ // {
// Arrange // // Arrange
string name1 = "Doe"; // string name1 = "Doe";
string firstName1 = "John"; // string firstName1 = "John";
string password1 = "123456"; // string password1 = "123456";
string name2 = "Doe"; // string name2 = "Doe";
string firstName2 = "John"; // string firstName2 = "John";
string password2 = "123456"; // string password2 = "123456";
// Act // // Act
Customer customer1 = new Customer(name1, firstName1, password1); // Customer customer1 = new Customer(name1, firstName1, password1);
Customer customer2 = new Customer(name2, firstName2, password2); // Customer customer2 = new Customer(name2, firstName2, password2);
// Assert // // Assert
Assert.True(customer1.Equals(customer2)); // Assert.True(customer1.Equals(customer2));
} // }
/// <summary> // /// <summary>
/// Teste l'égalité entre deux clients avec des identifiants différents. // /// Teste l'égalité entre deux clients avec des identifiants différents.
/// </summary> // /// </summary>
[Fact] // [Fact]
public void Equals_TwoDifferentCustomers_ReturnsFalse() // public void Equals_TwoDifferentCustomers_ReturnsFalse()
{ // {
// Arrange // // Arrange
string name1 = "Doe"; // string name1 = "Doe";
string firstName1 = "John"; // string firstName1 = "John";
string password1 = "123456"; // string password1 = "123456";
string name2 = "Smith"; // string name2 = "Smith";
string firstName2 = "Jane"; // string firstName2 = "Jane";
string password2 = "abcdef"; // string password2 = "abcdef";
// Act // // Act
Customer customer1 = new Customer(name1, firstName1, password1); // Customer customer1 = new Customer(name1, firstName1, password1);
Customer customer2 = new Customer(name2, firstName2, password2); // Customer customer2 = new Customer(name2, firstName2, password2);
// Assert // // Assert
Assert.False(customer1.Equals(customer2)); // Assert.False(customer1.Equals(customer2));
} // }
} // }
} //}

@ -1,62 +1,62 @@
/// \file ///// \file
/// \brief Définition de la classe Person. ///// \brief Définition de la classe Person.
/// \author Votre nom ///// \author Votre nom
using System; //using System;
using Model; //using Model;
namespace UnitTest //namespace UnitTest
{ //{
/// \file // /// \file
/// \brief Fichier de tests pour la classe Person. // /// \brief Fichier de tests pour la classe Person.
/// \author Votre nom // /// \author Votre nom
/// <summary> // /// <summary>
/// Classe de tests pour la classe Person. // /// Classe de tests pour la classe Person.
/// </summary> // /// </summary>
public class PersonTest // public class PersonTest
{ // {
/// <summary> // /// <summary>
/// Teste si les propriétés de l'objet Person sont correctement définies lorsque les arguments du constructeur sont valides. // /// Teste si les propriétés de l'objet Person sont correctement définies lorsque les arguments du constructeur sont valides.
/// </summary> // /// </summary>
[Fact] // [Fact]
public void Constructor_ValidArguments_PropertiesSet() // public void Constructor_ValidArguments_PropertiesSet()
{ // {
// Arrange // // Arrange
string name = "Doe"; // string name = "Doe";
string firstName = "John"; // string firstName = "John";
string password = "123456"; // string password = "123456";
// Act // // Act
Person person = new Person(name, firstName, password); // Person person = new Person(name, firstName, password);
// Assert // // Assert
Assert.Equal(name, person.Name); // Assert.Equal(name, person.Name);
Assert.Equal(firstName, person.FirstName); // Assert.Equal(firstName, person.FirstName);
Assert.Equal(password, person.Password); // Assert.Equal(password, person.Password);
} // }
/// <summary> // /// <summary>
/// Teste si l'identifiant de chaque instance de Person est correctement incrémenté. // /// Teste si l'identifiant de chaque instance de Person est correctement incrémenté.
/// </summary> // /// </summary>
[Fact] // [Fact]
public void Constructor_IncrementId() // public void Constructor_IncrementId()
{ // {
// Arrange // // Arrange
string name1 = "Doe"; // string name1 = "Doe";
string firstName1 = "John"; // string firstName1 = "John";
string password1 = "123456"; // string password1 = "123456";
string name2 = "Smith"; // string name2 = "Smith";
string firstName2 = "Jane"; // string firstName2 = "Jane";
string password2 = "abcdef"; // string password2 = "abcdef";
// Act // // Act
Person person1 = new Person(name1, firstName1, password1); // Person person1 = new Person(name1, firstName1, password1);
Person person2 = new Person(name2, firstName2, password2); // Person person2 = new Person(name2, firstName2, password2);
// Assert // // Assert
Assert.Equal(Convert.ToUInt32(0), person1.Id); // Assert.Equal(Convert.ToUInt32(0), person1.Id);
Assert.Equal(Convert.ToUInt32(1), person2.Id); // Assert.Equal(Convert.ToUInt32(1), person2.Id);
} // }
} // }
} //}

@ -16,6 +16,10 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

Loading…
Cancel
Save