Merge pull request 'Changed Stub, Models folder into Project. Added UnitTests project with few tests' (#42) from Matheo into master
continuous-integration/drone/push Build is passing
Details
Reviewed-on: #42pull/46/head
@ -1,6 +1,6 @@
|
||||
using MangaMap.Views;
|
||||
namespace MangaMap;
|
||||
using MangaMap.Model;
|
||||
using Models;
|
||||
using System.ComponentModel;
|
||||
using INotifyPropertyChanged = System.ComponentModel.INotifyPropertyChanged;
|
||||
|
Before Width: | Height: | Size: 231 B After Width: | Height: | Size: 231 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 265 B After Width: | Height: | Size: 265 B |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 101 KiB |
Before Width: | Height: | Size: 494 B After Width: | Height: | Size: 494 B |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 572 B After Width: | Height: | Size: 572 B |
Before Width: | Height: | Size: 154 KiB After Width: | Height: | Size: 154 KiB |
Before Width: | Height: | Size: 573 KiB After Width: | Height: | Size: 573 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
@ -1,5 +1,5 @@
|
||||
namespace MangaMap.Views.Composants;
|
||||
using MangaMap.Model;
|
||||
using Models;
|
||||
using System.Xml;
|
||||
|
||||
public partial class ListOeuvre : ContentView
|
@ -1,4 +1,4 @@
|
||||
using MangaMap.Model;
|
||||
using Models;
|
||||
|
||||
namespace MangaMap.Views.Composants
|
||||
{
|
@ -1,5 +1,5 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using MangaMap.Model;
|
||||
using Models;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Maui.Storage;
|
@ -1,6 +1,6 @@
|
||||
namespace MangaMap.Views
|
||||
{
|
||||
using Model;
|
||||
using Models;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
@ -1,6 +1,6 @@
|
||||
namespace MangaMap.Views
|
||||
{
|
||||
using MangaMap.Model;
|
||||
using Models;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
/// <summary>
|
@ -1,5 +1,5 @@
|
||||
namespace MangaMap.Views;
|
||||
using MangaMap.Model;
|
||||
using Models;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
namespace MangaMap.Views;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using MangaMap.Stub;
|
||||
using MangaMap.Model;
|
||||
using Stub;
|
||||
using Models;
|
||||
|
||||
/// <summary>
|
||||
/// Classe représentant la page de connexion administrateur de l'application.
|
@ -1,8 +1,8 @@
|
||||
namespace MangaMap.Views;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using MangaMap.Stub;
|
||||
using MangaMap.Model;
|
||||
using Stub;
|
||||
using Models;
|
||||
|
||||
/// <summary>
|
||||
/// Classe représentant la page de connexion de l'application.
|
@ -1,5 +1,5 @@
|
||||
namespace MangaMap.Views;
|
||||
using Model;
|
||||
using Models;
|
||||
|
||||
/// <summary>
|
||||
/// Classe représentant la page des paramètres de l'application.
|
@ -1,6 +1,6 @@
|
||||
namespace MangaMap.Views;
|
||||
|
||||
using MangaMap.Model;
|
||||
using Models;
|
||||
using System.Text.RegularExpressions;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Models\Models.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -0,0 +1,57 @@
|
||||
using Models;
|
||||
|
||||
namespace UnitTests
|
||||
{
|
||||
public class UnitTestUtilisateur
|
||||
{
|
||||
[Fact]
|
||||
public void TestUtilisateur()
|
||||
{
|
||||
// Arrange
|
||||
Utilisateur utilisateur = new Utilisateur("test@test.com", "pseudo", "mdp", "John", "Doe", 30);
|
||||
|
||||
// Act
|
||||
utilisateur.SupprimerUtilisateur();
|
||||
|
||||
// Assert
|
||||
Assert.Null(utilisateur.nom);
|
||||
Assert.Null(utilisateur.prenom);
|
||||
Assert.Equal(0, utilisateur.age);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Utilisateur_DefaultConstructor_SetsPropertiesToDefaultValues()
|
||||
{
|
||||
// Arrange & Act
|
||||
Utilisateur utilisateur = new Utilisateur();
|
||||
|
||||
// Assert
|
||||
Assert.Null(utilisateur.nom);
|
||||
Assert.Null(utilisateur.prenom);
|
||||
Assert.Equal(0, utilisateur.age);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Utilisateur_Constructor_SetsPropertiesCorrectly()
|
||||
{
|
||||
// Arrange
|
||||
string email = "test@test.com";
|
||||
string pseudo = "pseudo";
|
||||
string mdp = "mdp";
|
||||
string nom = "John";
|
||||
string prenom = "Doe";
|
||||
int age = 30;
|
||||
|
||||
// Act
|
||||
Utilisateur utilisateur = new Utilisateur(email, pseudo, mdp, nom, prenom, age);
|
||||
|
||||
// Assert
|
||||
Assert.Equal(email, utilisateur.Email);
|
||||
Assert.Equal(pseudo, utilisateur.Pseudo);
|
||||
Assert.Equal(mdp, utilisateur.MotDePasse);
|
||||
Assert.Equal(nom, utilisateur.nom);
|
||||
Assert.Equal(prenom, utilisateur.prenom);
|
||||
Assert.Equal(age, utilisateur.age);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
global using Xunit;
|