Compare commits

...

127 Commits

Author SHA1 Message Date
Matheo THIERRY 5d4ed6dd06 Merge branch 'developpement'
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY dae95895be base de base , fonctionnalité -
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY c321a864d2 Merge branch 'developpement'
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 7af8f8cb0d fix bug Database previous merge conflict
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY ab50893242 SUPP old data structure
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY 365742508e conflit fix
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY 9b2afcc6b2 oublie de datamember sur note
2 years ago
Liam MONCHANIN b113d34ecc navigation et connexion qui fonctionne
continuous-integration/drone/push Build was killed Details
2 years ago
Matheo THIERRY 13f9923f6c Add SaveDefaultData_Test to ToXML_Tests
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY c60fc07efc exclude all exception
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 9d40742045 ADD Save default and exclude exception from coverage
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 3ec2199411 end User_Tests.cs
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY d1875e97eb Add ToXml_Tests
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY b6fc6871ab fix StubTests
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 1f568ba29f Add Stub_Test
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY 975b5fbde7 fix change Exception to test
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 2eb4330263 work in progress UserTests
continuous-integration/drone/push Build is failing Details
2 years ago
Liam MONCHANIN 87533de711 Binding essai encore
continuous-integration/drone/push Build was killed Details
2 years ago
Matheo THIERRY 091b016244 try fixed sonar not working
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 46d86bc107 test coverage didn't working
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 76eece9089 change sln
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 1478707057 test sonar et add tempo path to xml
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY d2688b2d92 working in progress UserTests.cs
2 years ago
Matheo THIERRY b1d05eabfe oublie sauvegarde user test
2 years ago
Matheo THIERRY 2d177dc028 tranfers pour pc iut starting coding usertest
2 years ago
Matheo THIERRY 2071f8ba32 Fix persistance - working | database tests reworked
2 years ago
Matheo THIERRY 9bbd0f3e4f reglage bug programs et finition
2 years ago
Matheo THIERRY 1b4352e22b reglage
2 years ago
Matheo THIERRY 6ce50be142 upgrade program et fix class finished
2 years ago
Matheo THIERRY 6005c16a35 oublie database sauvegarde
2 years ago
Matheo THIERRY 72aa47ee35 tranfert pour continuer sur pc iut
2 years ago
Matheo THIERRY 67245868b2 debut huge upgrade
2 years ago
Matheo THIERRY ff86a3943d ADD badge et présentation simple
continuous-integration/drone/push Build is passing Details
2 years ago
Liam MONCHANIN 97b249813c Merge branch 'developpement' of https://codefirst.iut.uca.fr/git/matheo.thierry/notus into developpement
continuous-integration/drone/push Build was killed Details
2 years ago
Liam MONCHANIN 4291785f79 Ajout images pour les bouttons de la page de notes debut responsive vues Binding a reprendre pour la liste de notes
2 years ago
Matheo THIERRY f82b7bb9d7 erreur fix
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY f054b6c75d Merge branch 'persistance' into developpement
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY dbac7bb6b6 Fix hashCode to password for stub and for the reste
2 years ago
Matheo THIERRY 4129d5399f Upgrade persistance (v1 -> v2)
2 years ago
Matheo THIERRY f2796ec0a8 persistance v1
2 years ago
Matheo THIERRY 836bea188f remove refonte_program trigger from drone
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY ce37c078d4 upgrade stub.cs
2 years ago
Matheo THIERRY 2520531195 exclude program because he's technical tests
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY b77d0486d9 mistake
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 68dd5302af fix to build2
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY c75bac0219 fix to build
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY 9a79b6a8b2 setup to start upgrade persistance and adding correct stub
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY f6a86d2d14 fix bug in navigation and logic process
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 5a6ae644be program completed - test to sonar
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY dee2f48a41 je ne sais pas debug
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY f9a50c300c didnt change the equal to test
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY a8fdaa1bb6 fix test
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY 0c6def9fe7 dupli de code
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY 9b78f3ceca Fix failed user test (setup was wrong)
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 61c1e92469 ADD unitTests to user
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY 8fcb08ed63 Fix code smell
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY cff31cec4f ADD refonte branch to drone
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 56262c4b9d MODIF program
2 years ago
Liam MONCHANIN 575bd32287 imagebutton fleche_retour supprimé y en a un par defaut
continuous-integration/drone/push Build is passing Details
2 years ago
Liam MONCHANIN a764c8283d Stub effectué avec données à l'interieur
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 12a3bf0896 fixed Errors and Warnings
2 years ago
Matheo THIERRY 75226d8bb4 ADD starting menu, reworking connection and inscription
2 years ago
Liam MONCHANIN 6af577e2f2 debut ajout persistence(stub surtout) pour pouvoir faire binding
continuous-integration/drone/push Build is failing Details
2 years ago
Liam MONCHANIN 2104545171 modifications xaml
continuous-integration/drone/push Build is passing Details
2 years ago
Liam MONCHANIN 196b73c81a merge des vus text et recherche (recherPage) manque un richedit text pour les notes
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 4c77db58fa Database Fix Code smell3
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 296926684e Database Fix Code smell2
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY efaa4b878b Database Fix Code smell
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 7a89f4cff5 test4 exception
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 7304a8e6da test3 exception
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 6d567c9058 test2 exception
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 554431190d test exception
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY 2fffa70ff3 Drone MODIF to Notus_without_maui.sln
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 22f2bb4469 Fix drone to play all Test
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 5ed6a9b8d1 ADD Unit test to set fonction of note
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 0e7f6e2f4a fix by sonar code smell
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY d3b0e7b0a6 optimisation
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 96c7a0c679 fix all tests and ADD missing UnitTest
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY b44a761253 test ?
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY b44545a134 ADD exception file and try1 to fix code smell in database
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY 7b262d20c7 fix bug and other problem
continuous-integration/drone/push Build is passing Details
2 years ago
Liam MONCHANIN 5d4ae8b029 merge conflict test 2
continuous-integration/drone/push Build is failing Details
2 years ago
Liam MONCHANIN 3ba8819ee5 merge conflict test 1
continuous-integration/drone/push Build is failing Details
2 years ago
Liam MONCHANIN 5dca89b57b merge note
continuous-integration/drone/push Build is failing Details
2 years ago
Liam MONCHANIN a2c7b26e11 essai exeption null
2 years ago
Matheo THIERRY f534e27179 merge program
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY cfaf17f08a fix unit test note
2 years ago
Liam MONCHANIN 3245980afa Modification program.cs suite au rapport
continuous-integration/drone/push Build was killed Details
2 years ago
Matheo THIERRY b16da74e57 pb changement de imagenot name string to int pour correction de la méthode
continuous-integration/drone/push Build is passing Details
2 years ago
Matheo THIERRY 2b3b0dba3a UnitTest to Note (bugs not removed yet)
2 years ago
Liam MONCHANIN a0f039ed25 Essai sonar sans console
continuous-integration/drone/push Build is passing Details
2 years ago
Liam MONCHANIN c7a06eefa9 Essai fix Sonar
continuous-integration/drone/push Build is failing Details
2 years ago
Liam MONCHANIN ed360da803 Essai fix Sonar
continuous-integration/drone/push Build is failing Details
2 years ago
Liam MONCHANIN 7bcef40dbf Essai fix Sonar
continuous-integration/drone/push Build is failing Details
2 years ago
Liam MONCHANIN f2358887da Sonar
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY 81c4405a0d fix test build and test passed and try fix sonar
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY b1b08636cf test drone
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY e868ef7317 ouaip
continuous-integration/drone/push Build was killed Details
2 years ago
Liam MONCHANIN 23c03d38e7 Continuation de résolution de problèmes
continuous-integration/drone/push Build is failing Details
2 years ago
Liam MONCHANIN aae9370bca Continuation de résolution de problèmes
continuous-integration/drone/push Build is failing Details
2 years ago
Liam MONCHANIN a68a1e8812 tri variables
continuous-integration/drone/push Build is failing Details
2 years ago
Liam MONCHANIN f68ceba900 tri variables
continuous-integration/drone/push Build is failing Details
2 years ago
Liam MONCHANIN 0f995e1684 tri variables
continuous-integration/drone/push Build is failing Details
2 years ago
Liam MONCHANIN 40c88de727 Changement des set et get
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY a390297d33 merge completed to fix persistance
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY d34d420121 fix persistance v2
2 years ago
Matheo THIERRY 09029d2090 reglage pour merge avec persistance
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY 0e0cee204d fix persistence - tructure ok
2 years ago
Liam MONCHANIN 90c24358fd Ajout exeptions a changer pour voir si le program.cs buil dsur drone
continuous-integration/drone/push Build is failing Details
2 years ago
Liam MONCHANIN 5c8b68b4ac Program.cs correction erreurs il manque que les niveaux de protection sur les attributs
continuous-integration/drone/push Build is failing Details
2 years ago
Liam MONCHANIN 8c66398569 Program.cs correction erreurs
continuous-integration/drone/push Build is failing Details
2 years ago
Liam MONCHANIN 08403ec39a Program.cs maj anglais mais je m'etais trompé de branche
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY 8a92b3aad6 réglage des problèmes vé
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY 306d15b635 réglage des problèmes v1
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY bd25a436e1 fichier normalement supprimé toujour présent
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY f3b1db2903 j'ai oublié d'enlever head
continuous-integration/drone/push Build is failing Details
2 years ago
Matheo THIERRY 5f10a4b94d d'accord merci j'ai pas sauvegardé
continuous-integration/drone/push Build encountered an error Details
2 years ago
Matheo THIERRY 0ccdeda909 conflict
continuous-integration/drone/push Build encountered an error Details
2 years ago
Matheo THIERRY 5f68d68a9a Merge branch 'UnitTest' into developpement
2 years ago
Matheo THIERRY cb2cd438f1 tempo - pour merge
2 years ago
Liam MONCHANIN 0a8ca83e9c je teste
continuous-integration/drone/push Build is failing Details
2 years ago
Liam MONCHANIN d115e27b67 je teste
continuous-integration/drone/push Build is failing Details
2 years ago
Liam MONCHANIN e00886d710 je teste
continuous-integration/drone/push Build is failing Details
2 years ago
Liam MONCHANIN 1a1f50230c je teste
continuous-integration/drone/push Build is failing Details
2 years ago
Liam MONCHANIN 83f1ab948d je teste
continuous-integration/drone/push Build is failing Details
2 years ago
Liam MONCHANIN 373b91eee8 je teste
continuous-integration/drone/push Build is failing Details
2 years ago
Liam MONCHANIN d72054b9d7 je teste
2 years ago

@ -6,6 +6,7 @@ trigger:
branch:
- developpement
- master
- upgradeclass
event:
- push
@ -17,7 +18,6 @@ steps:
- dotnet restore notus_without_maui.sln
- dotnet build notus_without_maui.sln -c Release --no-restore /p:AndroidSdkDirectory=$ANDROID_SDK_ROOT -property:Aapt2ToolPath=$ANDROID_SDK_ROOT/build-tools/33.0.0
- dotnet publish notus_without_maui.sln -c Release --no-restore -o $CI_PROJECT_DIR/build/release
depends_on: [clone]
- name: tests
image: mcr.microsoft.com/dotnet/sdk:7.0
@ -30,19 +30,38 @@ steps:
- name: sonar
image: hub.codefirst.iut.uca.fr/marc.chevaldonne/codefirst-dronesonarplugin-dotnet7
secrets: [ Sonar_Login ]
settings:
environment:
sonar_host: https://codefirst.iut.uca.fr/sonar/
sonar_token:
from_secrets: Sonar_Login
from_secret: Sonar_Login
project_key: notus_ThMo
coverage_exclusions: "Tests/**/**,Notus_Console/**"
commands:
- cd notus/
- dotnet restore notus_without_maui.sln
- dotnet sonarscanner begin /k:notus /d:sonar.host.url=$${PLUGIN_SONAR_HOST} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions="Notus_UnitTest/**" /d:sonar.login=$${PLUGIN_SONAR_TOKEN}
- dotnet sonarscanner begin /k:$${project_key} /d:sonar.host.url=$${sonar_host} /d:sonar.coverageReportPaths="coveragereport/SonarQube.xml" /d:sonar.coverage.exclusions=$${coverage_exclusions} /d:sonar.login=$${sonar_token}
- dotnet build notus_without_maui.sln -c Release --no-restore
- dotnet test notus_without_maui.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" -verbosity:Verbose
- dotnet publish notus_without_maui.sln -c Release --no-restore -o CI_PROJECT_DIR/build/release
- dotnet sonarscanner end /d:sonar.login=$${PLUGIN_SONAR_TOKEN}
- dotnet sonarscanner end /d:sonar.login=$${sonar_token}
branch:
- vSonar_test
depends_on: [build,tests]
- developpement
depends_on: [build,tests]
- name: generate-and-deploy-docs
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-docdeployer
failure: ignore
volumes:
- name: docs
path: /docs
commands:
- /entrypoint.sh
when:
branch:
- master
# environment:
# NODOXYGEN: true
volumes:
- name: docs
temp: {}

@ -0,0 +1,12 @@
[![Build Status](https://codefirst.iut.uca.fr/api/badges/matheo.thierry/notus/status.svg)](https://codefirst.iut.uca.fr/matheo.thierry/notus)
[![Quality Gate Status](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=notus_ThMo&metric=alert_status&token=f49680ff7f8cbaaa0872d836ad12346debbf5164)](https://codefirst.iut.uca.fr/sonar/dashboard?id=notus_ThMo)
[![Coverage](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=notus_ThMo&metric=coverage&token=f49680ff7f8cbaaa0872d836ad12346debbf5164)](https://codefirst.iut.uca.fr/sonar/dashboard?id=notus_ThMo)
[![Lines of Code](https://codefirst.iut.uca.fr/sonar/api/project_badges/measure?project=notus_ThMo&metric=ncloc&token=f49680ff7f8cbaaa0872d836ad12346debbf5164)](https://codefirst.iut.uca.fr/sonar/dashboard?id=notus_ThMo)
# SAE 2.01 - Développement d'une application
## Présentation
Dans le cadre de la SAE, notre mission consiste à développer une application de prise de notes. Cette application sera un outil pratique pour les personnes qui cherchent à organiser leurs idées et leurs pensées.
Notre application sera facile à utiliser et intuitive, avec une interface simple et épurée qui permettra à l'utilisateur de s'orienter facilement. Elle permettra de partager les notes avec d'autres utilisateurs et de les gérer avec des tags. Lapplication sera personnalisable grâce à la possibilité de choisir parmi plusieurs thèmes et logos fournis. Les utilisateurs pourront également créer leurs propres thèmes.

@ -6,4 +6,8 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NHibernate" Version="5.4.2" />
</ItemGroup>
</Project>

@ -2,10 +2,12 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Web;
namespace Biblioteque_de_Class
{
@ -13,11 +15,18 @@ namespace Biblioteque_de_Class
public class Database
{
[DataMember]
private List<Logo> DefaultLogoList;
public List<Logo> DefaultLogoList { get; private set; }
[DataMember]
private List<Theme> ThemeList;
public List<Theme> ThemeList { get; private set; }
[DataMember]
private List<User> UserList;
public List<User> Users;
public List<User> UserList
{
get => Users; private set
{
Users = value;
}
}
public Database()
{
@ -26,34 +35,35 @@ namespace Biblioteque_de_Class
UserList = new List<User>();
}
public List<Logo> GetDefaultLogoList() { return DefaultLogoList; }
public List<Theme> GetThemeList() { return ThemeList; }
public List<User> GetUserList() { return UserList; }
public void SetDefaultLogoList(List<Logo> defaultLogoList) { DefaultLogoList = defaultLogoList; }
public void SetDefaultThemeList(List<Theme> defaultThemeList) { ThemeList = defaultThemeList; }
public void SetUserList(List<User> userList) { UserList = userList; }
/// <summary>
/// recherche un utilisateur dans la liste d'utilisateur
/// </summary>
public List<User> SearchUser(string name)
public User SearchUser(string name)
{
List<User> searchedUsers = new List<User>();
string search = name.ToLower();
foreach (User user in UserList)
foreach(User user in UserList)
{
if (user.GetUsername().ToLower().Contains(search)) { searchedUsers.Add(user); }
if (user.Username == name)
{
return user;
}
}
return searchedUsers;
throw new NotFoundException("No user found with this username.");
}
/// <summary>
/// récupérer le lien d'un logo
/// </summary>
public string GetLogoLink(string name)
public string? GetLogoLink(string name)
{
foreach (Logo logo in DefaultLogoList)
{
if (logo.GetName() == name) { return logo.GetLogoLink(); }
if (logo.Name == name) { return logo.LogoLink; }
}
throw new Exception("No logo link found.");
throw new NotFoundException("No logo link found.");
}
/// <summary>
@ -63,21 +73,18 @@ namespace Biblioteque_de_Class
{
foreach (User user in UserList)
{
if (user.GetUsername() == name)
if (user.Username == name)
{
return user;
}
}
throw new Exception("No user found with this username.");
throw new NotFoundException("No user found with this username.");
}
/// <summary>
/// comparer le mot de passe entré avec celui de l'utilisateur
/// </summary>
public bool ComparePassword(User user, string password)
{
return user.GetPassword() == password;
}
public static bool ComparePassword(User user, string? password) => user.Password == password;
/// <summary>
/// rechercher un mail dans la liste d'utilisateur
@ -86,7 +93,7 @@ namespace Biblioteque_de_Class
{
foreach (User user in UserList)
{
if (string.Equals(user.GetEmail(), email))
if (string.Equals(user.Email, email))
{
return true;
}
@ -101,16 +108,20 @@ namespace Biblioteque_de_Class
{
foreach (User existingUser in UserList)
{
if (existingUser.GetUsername() == user.GetUsername())
if (existingUser.Username == user.Username)
{
throw new Exception("Username already used.");
throw new AlreadyUsedException("Username already used.");
}
else if (existingUser.GetEmail() == user.GetEmail())
else if (user.Email != "")
{
throw new Exception("Email already used.");
if (existingUser.Email == user.Email)
{
throw new AlreadyUsedException("Email already used.");
}
}
}
UserList.Add(user);
user.CreateNote("", ""); // création d'une note vide pour l'utilisateur
}
/// <summary>
@ -124,7 +135,7 @@ namespace Biblioteque_de_Class
}
else
{
throw new Exception("User not found.");
throw new NotFoundException("User not found.");
}
}
@ -135,77 +146,65 @@ namespace Biblioteque_de_Class
{
foreach (Theme existingTheme in ThemeList)
{
if (existingTheme.GetName() == theme.GetName())
if (existingTheme.Name == theme.Name)
{
throw new Exception("Theme already used.");
throw new AlreadyExistException("Theme already Existing.");
}
}
ThemeList.Add(theme);
}
/// <summary>
/// supprimer un theme dans la liste de theme
/// </summary>
public void RemoveTheme(Theme theme)
{
if (ThemeList.Contains(theme))
{
ThemeList.Remove(theme);
}
else
{
throw new Exception("Theme not found.");
}
}
/// <summary>
/// récupérer un theme
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
/// <exception cref="NotFoundException"></exception>
public Theme GetTheme(string name)
{
foreach (Theme theme in ThemeList)
{
if (theme.GetName() == name)
if (theme.Name == name)
{
return theme;
}
}
throw new Exception("No theme found with this name.");
throw new NotFoundException("Theme not found.");
}
/// <summary>
/// modifier le nom d'un theme
/// changer le pseudo d'un utilisateur
/// </summary>
public void ModifyThemeName(Theme theme, string newName)
/// <param name="user"></param>
/// <param name="newUsername"></param>
/// <exception cref="AlreadyUsedException"></exception>
public void ChangeUsername(User user, string newUsername)
{
foreach (Theme existingTheme in ThemeList)
foreach(User existingUser in UserList)
{
if (existingTheme.GetName() == theme.GetName())
if(existingUser.Username == newUsername)
{
existingTheme.SetName(newName);
return;
throw new AlreadyUsedException("this username is already used.");
}
}
throw new Exception("Theme not found.");
user.Username = newUsername;
}
/// <summary>
/// modifier la liste de couleur d'un theme
/// vérifier si le nom du theme n'est pas déjà pris
/// </summary>
public void ModifyThemeColorList(Theme theme, List<string> newColorList)
/// <param name="name"></param>
/// <returns></returns>
public bool VerifThemeNameNotTaken(string name)
{
foreach (Theme existingTheme in ThemeList)
foreach (Theme theme in ThemeList)
{
if (existingTheme.GetName() == theme.GetName())
if (theme.Name == name)
{
for (int i = 0; i < 3; i++)
{
existingTheme.ChangeColor(existingTheme.GetColor(i), newColorList[i]);
}
return;
return false;
}
}
throw new Exception("Theme not found.");
return true;
}
}
}

@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace Biblioteque_de_Class
{
[Serializable, ExcludeFromCodeCoverage]
public class NotAllowedException : Exception
{
public NotAllowedException(string message) : base(message)
{
}
protected NotAllowedException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
[Serializable, ExcludeFromCodeCoverage]
public class AlreadyUsedException : Exception
{
public AlreadyUsedException(string message) : base(message)
{
}
protected AlreadyUsedException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
[Serializable, ExcludeFromCodeCoverage]
public class NotFoundException : Exception
{
public NotFoundException(string message) : base(message)
{
}
protected NotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
[Serializable, ExcludeFromCodeCoverage]
public class AlreadyExistException : Exception
{
public AlreadyExistException(string message) : base(message)
{
}
protected AlreadyExistException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
[Serializable, ExcludeFromCodeCoverage]
public class FileException : Exception
{
public FileException(string message) : base(message)
{
}
protected FileException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace Biblioteque_de_Class
{
public class HashCodeModel
{
public static string GetSHA256Hash(string input)
{
using (SHA256 sha256Hash = SHA256.Create())
{
byte[] bytes = sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(input));
StringBuilder builder = new StringBuilder();
for (int i = 0; i < bytes.Length; i++)
{
builder.Append(bytes[i].ToString("x2"));
}
return builder.ToString();
}
}
}
}

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Biblioteque_de_Class
{
public interface IManager
{
public void SaveDatabaseData(List<User> UserList);
public void SaveDefaultData(List<Theme> DefaultThemeList, List<Logo> DefaultLogoList);
public List<User> LoadDatabaseData();
public List<Theme> LoadDefaultTheme();
public List<Logo> LoadDefaultLogo();
}
}

@ -1,15 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace Biblioteque_de_Class
{
[DataContract]
public class Logo
{
private string Name { get; set; }
private string LogoLink { get; set; }
[DataMember]
public string Name { get; set; }
[DataMember]
public string LogoLink { get; set; }
public Logo(string name, string logoLink)
{
@ -17,12 +21,6 @@ namespace Biblioteque_de_Class
LogoLink = logoLink;
}
public string GetName() { return Name; }
public string GetLogoLink() { return LogoLink; }
public void SetName(string name) { Name = name; }
public void SetLogoLink(string logoLink) { LogoLink = logoLink; }
public override string ToString() => $"Logo -> Name: {Name}\nLink: {LogoLink}";
}
}

@ -1,86 +1,132 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
using System.Drawing;
using System.Runtime.Serialization;
namespace Biblioteque_de_Class
{
public class Note
[DataContract(IsReference = true)]
public class Note : INotifyPropertyChanged
{
private string Name
[DataMember]
public int id { get; init; }
[DataMember]
private string name;
[DataMember]
public string Name
{
get { return Name; }
set { if (value == null) { Name = "Unnamed Note"; } else { Name = value; } }
get { return name; }
set { if (value == "") { name = "Unnamed Note"; } else { name = value; } OnPropertyChanged(nameof(Name)); }
}
///private string Text { get; set; } Attribut pour le texte de la note
private string LogoPath
[DataMember]
private string text;
public string Text {
get => text;
set {
text = value;
OnPropertyChanged(nameof(Text));
} }
[DataMember]
private string logoPath;
[DataMember]
public string LogoPath
{
get { return LogoPath; }
set { if (value == null) { LogoPath = "PATH TO DEFAULT LOGO"; } else { LogoPath = value; } }
get { return logoPath; }
private set { if (value == "") { logoPath = "PATH TO DEFAULT LOGO"; } else { logoPath = value; } OnPropertyChanged(nameof(LogoPath)); }
}
private DateOnly CreationDate { get; }
private DateOnly ModificationDate { get; set; }
private List<NoteImage> ImageList;
private List<string> TextLineList;
private List<User> Collaborators;
private List<User> Editors;
private User Owner;
[DataMember]
public DateOnly CreationDate { get; init; }
[DataMember]
public DateOnly ModificationDate { get; private set; }
[DataMember]
public List<NoteImage> ImageList { get; private set; }
[DataMember]
public List<User> Collaborators { get; private set; }
[DataMember]
public List<User> Editors { get; private set; }
[DataMember]
public User Owner { get; private set; }
public bool isfavorite;
public bool IsFavorite
{
get => isfavorite;
set
{
isfavorite = value;
OnPropertyChanged(nameof(IsFavorite));
}
}
public event PropertyChangedEventHandler PropertyChanged;
public Note(string name, string logoPath, User owner)
protected virtual void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public Note(int initId,string name, string logoPath, User owner)
{
id = initId;
Name = name;
LogoPath = logoPath;
CreationDate = DateOnly.FromDateTime(DateTime.Now);
ModificationDate = DateOnly.FromDateTime(DateTime.Now);
ImageList = new List<NoteImage>();
TextLineList = new List<string>();
Collaborators = new List<User>();
Editors = new List<User>();
Editors = new List<User>() { owner };
Owner = owner;
}
public string GetName() { return Name; }
public string GetLogoPath() { return LogoPath; }
public DateOnly GetCreationDate() { return CreationDate; }
public DateOnly GetModificationDate() { return ModificationDate; }
public List<NoteImage> GetImageList() { return ImageList; }
public List<string> GetTextLineList() { return TextLineList; }
public List<User> GetCollaborators() { return Collaborators; }
public List<User> GetEditors() { return Editors; }
public User GetOwner() { return Owner; }
public override string ToString() => $"Note -> Name: {Name}\nLogoPath: {LogoPath}\nNumber of lines: {TextLineList.Count()}";
public void SetName(string name) { Name = name; }
public void SetLogoPath(string logoPath) { LogoPath = logoPath; }
public void SetModificationDate() { ModificationDate = DateOnly.FromDateTime(DateTime.Now); }
public override string ToString() => $"Note -> Name: {Name}\nLogoPath: {LogoPath}";
/// <summary>
/// vérifier si l'utilisateur est le propriétaire de la note
/// </summary>
public bool VerifyOwner(User user)
{
return user == Owner;
{
if (user == Owner) { return true; }
else { throw new NotAllowedException("User is not the owner"); }
}
public void AddImage(string imageLink, string position)
/// <summary>
/// ajouter une image à la note
/// </summary>
/// <param name="imageLink"></param>
/// <param name="position"></param>
public void AddImage(string imageLink, List<int> position)
{
string newname = (ImageList.Count + 1).ToString();
ImageList.Add(new NoteImage(newname, imageLink, position));
}
/// <summary>
/// supprimer une image de la note
/// </summary>
/// <param name="name"></param>
/// <exception cref="NotFoundException"></exception>
public void RemoveImage(string name)
{
foreach (NoteImage image in ImageList)
{
if (image.GetImageLink() == imageLink)
if (image.Name == name)
{
/// Do something
ImageList.Remove(image);
return;
}
}
throw new NotFoundException("Image not found");
}
public void RemoveImage(string image)
/// <summary>
/// ajouter du texte à la note
/// </summary>
/// <param name="text"></param>
public void AddText( User user, string text)
{
/// Need a new data structure to store images
if (user == Owner || Editors.Contains(user)) { ModificationDate = DateOnly.FromDateTime(DateTime.Now); }
else { throw new NotAllowedException("User is not the owner or an editor"); }
Text = Text + "\n" + text;
}
/// <summary>
@ -88,14 +134,7 @@ namespace Biblioteque_de_Class
/// </summary>
public bool VerifyPrivilege(User user)
{
if (Editors.Contains(user))
{
return true;
}
else
{
throw new Exception("User is not an editor");
}
return Editors.Contains(user);
}
/// <summary>
@ -104,7 +143,7 @@ namespace Biblioteque_de_Class
public void AddCollaborator(User owner, User user)
{
if (VerifyOwner(owner)) { Collaborators.Add(user); }
else { throw new Exception("User is not the owner"); }
user.NoteList.Add(this);
}
/// <summary>
@ -113,7 +152,7 @@ namespace Biblioteque_de_Class
public void RemoveCollaborator(User owner, User user)
{
if (VerifyOwner(owner)) { Collaborators.Remove(user); }
else { throw new Exception("User is not the owner"); }
user.NoteList.Remove(this);
}
/// <summary>
@ -121,8 +160,8 @@ namespace Biblioteque_de_Class
/// </summary>
public void AddEditor(User owner, User user)
{
if (Editors.Contains(user)) { throw new AlreadyExistException("user already in editors."); }
if (VerifyOwner(owner)) { Editors.Add(user); }
else { throw new Exception("User is not the owner"); }
}
/// <summary>
@ -130,8 +169,28 @@ namespace Biblioteque_de_Class
/// </summary>
public void RemoveEditor(User owner, User user)
{
if (!Editors.Contains(user)) { throw new NotFoundException("user not found in editors."); }
if (VerifyOwner(owner)) { Editors.Remove(user); }
else { throw new Exception("User is not the owner"); }
}
/// <summary>
/// changer le nom de la note
/// </summary>
/// <param name="user"></param>
/// <param name="newName"></param>
public void ChangeName(User user, string newName)
{
if (VerifyOwner(user)) { Name = newName; }
}
/// <summary>
/// changer le logo de la note
/// </summary>
/// <param name="user"></param>
/// <param name="newLogoPath"></param>
public void ChangeLogo(User user, string newLogoPath)
{
if (VerifyOwner(user)) { LogoPath = newLogoPath; }
}
}
}

@ -1,32 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace Biblioteque_de_Class
{
[DataContract]
public class NoteImage
{
private string Name { get; set; }
private string ImageLink { get; set; }
private string Position { get; set; }
[DataMember]
public string Name { get; set; }
[DataMember]
public string ImageLink { get; set; }
[DataMember]
public List<int> Position { get; set; }
public NoteImage(string name, string imageLink, string position)
public NoteImage(string name, string imageLink, List<int> position)
{
Name = name;
ImageLink = imageLink;
Position = position;
}
public string GetName() { return Name; }
public string GetImageLink() { return ImageLink; }
public string GetPosition() { return Position; }
public void SetName(string name) { Name = name; }
public void SetImageLink(string imageLink) { ImageLink = imageLink; }
public void SetPosition(string position) { Position = position; }
public override string ToString() => $"image -> name: {Name}\nlink: {ImageLink}";
}
}

@ -0,0 +1,52 @@
using Microsoft.VisualBasic;
namespace Biblioteque_de_Class
{
public class PersistenceManager
{
private Database db = new Database();
private readonly IManager persistence;
public PersistenceManager(IManager pers)
{
persistence = pers;
}
public void SaveDatabaseData(Database database)
{
persistence.SaveDatabaseData(database.UserList);
}
public void SaveDefaultData(Database database)
{
persistence.SaveDefaultData(database.ThemeList, database.DefaultLogoList);
}
public Database LoadDatabaseData()
{
db.SetUserList(persistence.LoadDatabaseData());
db.SetDefaultThemeList(persistence.LoadDefaultTheme());
db.SetDefaultLogoList(persistence.LoadDefaultLogo());
return db;
}
public Database GetOnlyDatabaseUser()
{
db.SetUserList(persistence.LoadDatabaseData());
return db;
}
public Database GetOnlyDatabaseDefaultTheme()
{
db.SetDefaultThemeList(persistence.LoadDefaultTheme());
return db;
}
public Database GetOnlyDatabaseDefaultLogo()
{
db.SetDefaultLogoList(persistence.LoadDefaultLogo());
return db;
}
}
}

@ -1,27 +1,58 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace Biblioteque_de_Class
{
[DataContract]
public class Tags
{
private string Name { get; set; }
private string Color { get; set; }
[DataMember]
private string name;
public string Name
{
get { return name; }
set
{
if (name != value)
{
name = value;
OnPropertyChanged(nameof(Name));
}
}
}
[DataMember]
private string color;
public string Color
{
get { return color; }
set
{
if (color != value)
{
color = value;
OnPropertyChanged(nameof(Color));
}
}
}
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public Tags(string name, string color)
{
Name = name;
Color = color;
}
public string GetName() { return Name; }
public string GetColor() { return Color; }
public void SetName(string name) { Name = name; }
public void SetColor(string color) { Color = color; }
public override string ToString() => $"tag -> name: {Name}\ncolor: {Color}";
}
}

@ -1,15 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace Biblioteque_de_Class
{
[DataContract]
public class Theme
{
private string Name { get; set; }
private List<string> ColorList;
[DataMember]
public string Name { get; set; }
[DataMember]
public List<string> ColorList { get; private set; }
public Theme(string name, List<string> colorList)
{
@ -17,11 +21,6 @@ namespace Biblioteque_de_Class
ColorList = colorList;
}
public string GetName() { return Name; }
public void SetName(string name) { Name = name; }
public List<string> GetColorList() { return ColorList; }
public string GetColor(int index) { return ColorList[index]; }
public override string ToString() => $"name: {Name}\ncolor 1: {ColorList[0]}\ncolor 2: {ColorList[1]}\ncolor 3: {ColorList[2]}\n";
/// <summary>

@ -1,245 +1,627 @@
using Microsoft.VisualBasic.FileIO;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;
namespace Biblioteque_de_Class
{
[DataContract]
public class User
{
[DataMember]
private string Username { get; set; }
[DataMember]
private string Email { get; set; }
[DataMember]
private string Password { get; set; }
[DataMember]
private List<Note> NoteList;
[DataMember]
private List<Tags> TagList;
[DataMember]
private List<Note> FavList;
[DataMember]
private bool IsConnected { get; set; }
[DataMember]
private Dictionary<Note, List<Tags>> NoteTagged;
public User(string username, string email, string password)
{
Username = username;
Email = email;
Password = password;
NoteList = new List<Note>();
TagList = new List<Tags>();
FavList = new List<Note>();
NoteTagged = new Dictionary<Note, List<Tags>>();
}
public string GetUsername() { return Username; }
public string GetEmail() { return Email; }
public string GetPassword() { return Password; }
public List<Note> GetNoteList() { return NoteList; }
public List<Tags> GetTagList() { return TagList; }
public List<Note> GetFavList() { return FavList; }
public bool GetIsConnected() { return IsConnected; }
public Dictionary<Note, List<Tags>> GetNoteTagged() { return NoteTagged; }
public void SetUsername(string username) { Username = username; }
public void SetEmail(string email) { Email = email; }
public void SetPassword(string password) { Password = password; }
public void SetIsConnected(bool isConnected) { IsConnected = isConnected; }
public override string ToString() => $"username: {Username}\nemail: {Email}\npassword: {Password}\nOwned notes: {NoteList.Count}";
/// <summary>
/// rechercher une note dans la liste de note de l'utilisateur
/// </summary>
public List<Note> SearchNoteByName(string name)
{
List<Note> searchedNotes = new List<Note>();
string search = name.ToLower();
foreach (Note note in NoteList)
{
if (note.GetName().ToLower().Contains(search))
{
searchedNotes.Add(note);
}
}
return searchedNotes;
}
/// <summary>
/// rechercher une note dans la liste de note favoris de l'utilisateur
/// </summary>
public List<Note> SearchFavoriteNoteByName(string name)
{
List<Note> searchedNotes = new List<Note>();
string search = name.ToLower();
foreach (Note note in FavList)
{
if (note.GetName().ToLower().Contains(search))
{
searchedNotes.Add(note);
}
}
return searchedNotes;
}
/// <summary>
/// rechercher un tag dans la liste de tag de l'utilisateur
/// </summary>
public List<Tags> SearchTagByName(string name)
{
List<Tags> searchedTags = new List<Tags>();
string search = name.ToLower();
foreach (Tags tag in TagList)
{
if (tag.GetName().ToLower().Contains(search))
{
searchedTags.Add(tag);
}
}
return searchedTags;
}
/// <summary>
/// ajouter une note dans la liste de note favorite de l'utilisateur
/// </summary>
public void AddFavorite(Note note)
{
if (FavList.Contains(note))
{
throw new Exception("Note already in favorites");
}
FavList.Add(note);
}
/// <summary>
/// supprimer une note dans la liste de note favorite de l'utilisateur
/// </summary>
public void RemoveFavorite(Note note)
{
if (FavList.Contains(note))
{
FavList.Remove(note);
}
else
{
throw new Exception("Note not found");
}
}
/// <summary>
///creer une note
/// </summary>
public void CreateNote(string name, string imagePath)
{
foreach (Note existingNote in NoteList)
{
if (existingNote.GetName() == name)
{
throw new Exception("Note already exists");
}
}
Note note = new Note(name, imagePath, this);
NoteList.Add(note);
NoteTagged.Add(note, new List<Tags>());
}
/// <summary>
/// supprimer une note
/// </summary>
public void DeleteNote(Note note)
{
if (NoteList.Contains(note))
{
NoteList.Remove(note);
NoteTagged.Remove(note);
}
else
{
throw new Exception("Note not found");
}
}
/// <summary>
/// creer un tag
/// </summary>
public void CreateTag(string name, string color)
{
foreach (Tags tag in TagList)
{
if (tag.GetName() == name)
{
throw new Exception("Tag already exists");
}
}
TagList.Add(new Tags(name, color));
}
/// <summary>
/// supprimer un tag
/// </summary>
public void DeleteTag(string name)
{
foreach (Tags tag in TagList)
{
if (tag.GetName() == name)
{
TagList.Remove(tag);
return;
}
}
}
/// <summary>
/// ajouter un tag a une note
/// </summary>
public void AddTagToNoteList(Note note, Tags tagToAdd)
{
if (!TagList.Contains(tagToAdd))
{
throw new Exception("Tag not found");
}
if (!NoteList.Contains(note))
{
throw new Exception("Note not found");
}
NoteTagged[note].Add(tagToAdd);
}
/// <summary>
/// supprimer un tag a une note
/// </summary>
public void RemoveTagFromNoteList(Note note, Tags tagToRemove)
{
if (!TagList.Contains(tagToRemove))
{
throw new Exception("Tag not found");
}
if (!NoteList.Contains(note))
{
throw new Exception("Note not found");
}
NoteTagged[note].Remove(tagToRemove);
}
/// <summary>
/// ajouter plusieur tag a une note
/// </summary>
public void AddTagsToNoteList(Note note, List<Tags> tags)
{
NoteTagged.Add(note, tags);
}
/// <summary>
///supprimer tout les tags d'une note
/// </summary>
public void RemoveTagsFromNoteList(Note note)
{
NoteTagged.Remove(note);
}
}
using Microsoft.VisualBasic.FileIO;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;
namespace Biblioteque_de_Class
{
[DataContract]
public class User : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
[DataMember]
private string username;
public string Username
{
get { return username; }
set
{
if (username == value)
return;
username = value;
OnPropertyChanged(nameof(Username));
}
}
[DataMember]
private string email;
public string Email
{
get { return email; }
set
{
if (email == value)
return;
email = value;
OnPropertyChanged(nameof(Email));
}
}
[DataMember]
private string password;
public string Password
{
get { return password; }
set
{
if (password == value)
return;
password = value;
OnPropertyChanged(nameof(Password));
}
}
[DataMember]
private string picture;
public string Picture
{
get { return picture; }
set
{
if (picture == value)
return;
picture = value;
OnPropertyChanged(nameof(Picture));
}
}
[DataMember]
private Theme useTheme;
public Theme UseTheme
{
get { return useTheme; }
set
{
if (useTheme == value)
return;
useTheme = value;
OnPropertyChanged(nameof(UseTheme));
}
}
[DataMember]
private List<Note> noteList;
public List<Note> NoteList
{
get { return noteList; }
set
{
if (noteList == value)
return;
noteList = value;
OnPropertyChanged(nameof(NoteList));
}
}
[DataMember]
private List<Tags> tagList;
public List<Tags> TagList
{
get { return tagList; }
set
{
if (tagList == value)
return;
tagList = value;
OnPropertyChanged(nameof(TagList));
}
}
[DataMember]
private List<Note> favList;
public List<Note> FavList
{
get { return favList; }
set
{
if (favList == value)
return;
favList = value;
OnPropertyChanged(nameof(FavList));
}
}
[DataMember(EmitDefaultValue = false)]
private bool isConnected;
public bool IsConnected
{
get { return isConnected; }
set
{
if (isConnected == value)
return;
isConnected = value;
OnPropertyChanged(nameof(IsConnected));
}
}
[DataMember]
private Dictionary<Note, List<Tags>> noteTagged;
public Dictionary<Note, List<Tags>> NoteTagged
{
get { return noteTagged; }
set
{
if (noteTagged == value)
return;
noteTagged = value;
OnPropertyChanged(nameof(NoteTagged));
}
}
[DataMember]
private List<Theme> addedTheme;
public List<Theme> AddedTheme
{
get { return addedTheme; }
set
{
if (addedTheme == value)
return;
addedTheme = value;
OnPropertyChanged(nameof(AddedTheme));
}
}
public User(string username, string email, string password)
{
Username = username;
Email = email;
Password = password;
Picture = "defaultpicture.png";
UseTheme = new("", ",,".Split(',').ToList());
NoteList = new List<Note>();
TagList = new List<Tags>();
FavList = new List<Note>();
NoteTagged = new Dictionary<Note, List<Tags>>();
AddedTheme = new List<Theme>();
}
public override string ToString() => $"username: {Username}\nemail: {Email}\npassword: {Password}\nOwned notes: {NoteList.Count}";
/// <summary>
/// rechercher une note dans la liste de note de l'utilisateur et la liste de note favoris de l'utilisateur
/// </summary>
public List<Note> SearchNoteByName(List<Note> toResearchIntoList, string name)
{
List<Note> searchedNotes = new List<Note>();
string search = name.ToLower();
foreach (Note note in toResearchIntoList)
{
if (note.Name.ToLower().Contains(search))
{
searchedNotes.Add(note);
}
}
return searchedNotes;
}
public List<Note> SearchNoteByTag(List<Note> toResearchIntoList, string name)
{
List<Note> searchedNotes = new();
Tags tagtoresearchby = GetTagByName(name);
foreach(Note note in toResearchIntoList)
{
if (NoteTagged[note].Contains(tagtoresearchby))
{
searchedNotes.Add(note);
}
}
return searchedNotes;
}
/// <summary>
/// rechercher un tag dans la liste de tag de l'utilisateur
/// </summary>
public List<Tags> SearchTagByName(List<Tags> ToResearchIntoList, string name)
{
List<Tags> searchedTags = new List<Tags>();
string search = name.ToLower();
foreach (Tags tag in ToResearchIntoList)
{
if (tag.Name.ToLower().Contains(search))
{
searchedTags.Add(tag);
}
}
return searchedTags;
}
/// <summary>
/// rechercher par date de création ou de modification
/// </summary>
/// <param name="ToResearchIntoList"></param>
/// <param name="name"></param>
/// <param name="FirstDate"></param>
/// <param name="SecondeDate"></param>
/// <returns></returns>
public List<Note> SearchNoteByDate(List<Note> ToResearchIntoList, string name, DateOnly FirstDate, DateOnly SecondeDate)
{
List<Note> searchedNotes = new List<Note>();
string search = name.ToLower();
foreach (Note note in ToResearchIntoList)
{
if (note.Name.ToLower().Contains(search) && note.CreationDate >= FirstDate && note.CreationDate <= SecondeDate || note.Name.ToLower().Contains(search) && note.ModificationDate >= FirstDate && note.ModificationDate <= SecondeDate)
{
searchedNotes.Add(note);
}
}
return searchedNotes;
}
/// <summary>
/// rechercher par nom de la note
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
/// <exception cref="NotFoundException"></exception>
public Note GetNoteByName(string name)
{
foreach (Note note in NoteList)
{
if (note.Name == name)
{
return note;
}
}
throw new NotFoundException("Note not found");
}
/// <summary>
/// rechercher par nom du tag
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
/// <exception cref="NotFoundException"></exception>
public Tags GetTagByName(string name)
{
foreach (Tags tag in TagList)
{
if (tag.Name == name)
{
return tag;
}
}
throw new NotFoundException("Tag not found");
}
/// <summary>
/// ajouter une note dans la liste de note favorite de l'utilisateur
/// </summary>
public void AddFavorite(Note note)
{
if (FavList.Contains(note))
{
throw new AlreadyExistException("Note already in favorites");
}
FavList.Add(note);
note.IsFavorite = true;
}
/// <summary>
/// supprimer une note dans la liste de note favorite de l'utilisateur
/// </summary>
public void RemoveFavorite(Note note)
{
if (FavList.Contains(note))
{
FavList.Remove(note);
note.IsFavorite = false;
}
else
{
throw new NotFoundException("Note not found");
}
}
/// <summary>
///creer une note
/// </summary>
public Note CreateNote(string name, string imagePath)
{
if (name != "")
{
foreach (Note existingNote in NoteList)
{
if (existingNote.Name == name)
{
throw new AlreadyExistException("Note already exists");
}
}
}
Note note;
if (NoteList.Count == 0) { note = new Note(0, name, imagePath, this); }
else { note = new Note(NoteList[NoteList.Count - 1].id + 1, name, imagePath, this); }
NoteList.Add(note);
NoteTagged.Add(note, new List<Tags>());
return note;
}
/// <summary>
/// supprimer une note
/// </summary>
public void DeleteNote(Note note)
{
note.VerifyOwner(this);
foreach (Note existingNote in NoteList)
{
if (existingNote == note)
{
NoteList.Remove(existingNote);
NoteTagged.Remove(existingNote);
return;
}
}
throw new NotFoundException("Note not found");
}
/// <summary>
/// creer un tag
/// </summary>
public void CreateTag(string name, string color)
{
foreach (Tags tag in TagList)
{
if (tag.Name == name)
{
throw new AlreadyExistException("Tag already exists");
}
}
TagList.Add(new Tags(name, color));
}
/// <summary>
/// supprimer un tag
/// </summary>
public void DeleteTag(Tags tagtodelete)
{
foreach (Tags tag in TagList)
{
if (tag == tagtodelete)
{
TagList.Remove(tag);
return;
}
}
throw new NotFoundException("Tag not found");
}
public void EditTagName(Tags tag, string newName)
{
if (!TagList.Contains(tag))
{
throw new NotFoundException("Tag not found");
}
else
{
foreach (Tags existingTag in TagList)
{
if (existingTag.Name == newName)
{
throw new AlreadyExistException("Tag already exists");
}
}
}
tag.Name = newName;
}
public void EditTagColor(Tags tag, string newColor)
{
if (!TagList.Contains(tag))
{
throw new NotFoundException("Tag not found");
}
tag.Color = newColor;
}
/// <summary>
/// ajouter un tag a une note
/// </summary>
public void AddTagFromNoteList(Note note, Tags tagToAdd)
{
if (!TagList.Contains(tagToAdd))
{
throw new NotFoundException("Tag not found");
}
if (!NoteList.Contains(note))
{
throw new NotFoundException("Note not found");
}
NoteTagged[note].Add(tagToAdd);
}
/// <summary>
/// supprimer un tag a une note
/// </summary>
public void RemoveTagFromNoteList(Note note, Tags tagToRemove)
{
if (!TagList.Contains(tagToRemove))
{
throw new NotFoundException("Tag not found");
}
if (!NoteList.Contains(note))
{
throw new NotFoundException("Note not found");
}
NoteTagged[note].Remove(tagToRemove);
}
/// <summary>
/// modifier le nom d'une note
/// </summary>
/// <param name="note"></param>
/// <param name="newname"></param>
/// <exception cref="AlreadyUsedException"></exception>
public void SetNoteName(Note note, string newname)
{
if (!NoteList.Contains(note))
{
throw new NotFoundException("Note not found");
}
foreach(Note n in NoteList)
{
if(n.Name == newname)
{
throw new AlreadyUsedException("This name is already used");
}
}
note.Name = newname;
}
/// <summary>
/// modifier le mot de passe de l'utilisateur
/// </summary>
/// <param name="newPassword"></param>
/// <exception cref="AlreadyExistException"></exception>
/// <exception cref="NotAllowedException"></exception>
public void ChangePassword(string newPassword)
{
if (newPassword.Length < 8) { throw new NotAllowedException("this password is too short."); }
if (Password == HashCodeModel.GetSHA256Hash(newPassword).ToString())
{
throw new AlreadyUsedException("this password is already used.");
}
else
{
Password = HashCodeModel.GetSHA256Hash(newPassword).ToString();
}
}
/// <summary>
/// modifier le theme de l'utilisateur
/// </summary>
/// <param name="theme"></param>
/// <exception cref="AlreadyExistException"></exception>
public void ChangeTheme(Theme theme)
{
if (UseTheme.Name == theme.Name)
{
throw new AlreadyExistException("this theme is already selected.");
}
UseTheme = theme;
}
public void ChangeThemeName(Theme theme, string newName)
{
foreach (Theme existingTheme in AddedTheme)
{
if (existingTheme.Name == newName)
{
throw new AlreadyExistException("this theme is already existing.");
}
}
if (theme.Name == newName)
{
throw new AlreadyExistException("this theme is already selected.");
}
theme.Name = newName;
}
public void ChangeThemeColors(Theme theme, List<string> newColor)
{
int compteurSameColor = 0;
for(int i = 0; i < theme.ColorList.Count; i++)
{
if (theme.ColorList[i] == newColor[i])
{
compteurSameColor++;
}
}
if (compteurSameColor == theme.ColorList.Count)
{
throw new AlreadyExistException("this theme those colors");
}
if (theme.ColorList.Count != newColor.Count)
{
throw new NotFoundException("this theme doesn't have the same number of colors");
}
for (int i = 0; i < theme.ColorList.Count; i++)
{
theme.ChangeColor(theme.ColorList[i], newColor[i]);
}
}
/// <summary>
/// ajouter un theme dans la liste de theme
/// </summary>
public void AddTheme(Theme theme)
{
foreach (Theme existingTheme in AddedTheme)
{
if (existingTheme.Name == theme.Name)
{
throw new AlreadyExistException("Theme already used.");
}
}
AddedTheme.Add(theme);
}
/// <summary>
/// supprimer un theme dans la liste de theme
/// </summary>
public void RemoveTheme(Theme theme)
{
if (AddedTheme.Contains(theme))
{
AddedTheme.Remove(theme);
}
else
{
throw new NotFoundException("Theme not found.");
}
}
/// <summary>
/// recuperer un theme dans la liste de theme ajouté par l'utilisateur
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
/// <exception cref="NotFoundException"></exception>
public Theme GetTheme(string name)
{
foreach (Theme theme in AddedTheme)
{
if (theme.Name == name)
{
return theme;
}
}
throw new NotFoundException("Theme not found.");
}
/// <summary>
/// modifier l'email de l'utilisateur
/// </summary>
/// <param name="newEmail"></param>
/// <exception cref="AlreadyExistException"></exception>
public void ChangeEmail(string newEmail)
{
if (newEmail.Length < 3 ) { throw new NotAllowedException("this is not a mail address."); }
if (Email == newEmail) { throw new AlreadyUsedException("this email is the same."); }
Email = newEmail;
}
/// <summary>
/// changer la photo de profil de l'utilisateur
/// </summary>
/// <param name="path"></param>
public void ChangeProfilePicture(string path)
{
if (path.Length < 3)
{
Picture = "default.png";
}
else
{
List<string> picture = new();
picture = path.Split('.').ToList();
string extension = picture.Last();
if (extension != "png" && extension != "jpg" && extension != "jpeg")
{
throw new NotFoundException("this extension is not allowed.");
}
Picture = path;
}
}
public void SetDefaultTheme(Theme theme)
{
UseTheme = theme;
}
}
}

@ -1,18 +0,0 @@
using Notus_Persistance;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Notus_Console
{
public class Manager
{
PersistenceManager pers { get; set; }
public Manager(PersistenceManager pers)
{
this.pers = pers;
}
}
}

@ -9,6 +9,7 @@
<ItemGroup>
<ProjectReference Include="..\Biblioteque_de_Class\Biblioteque_de_Class.csproj" />
<ProjectReference Include="..\Notus_Persistence\Notus_Persistance.csproj" />
</ItemGroup>
</Project>

File diff suppressed because it is too large Load Diff

@ -1,14 +0,0 @@
using Biblioteque_de_Class;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Notus_Persistance
{
public class Manager : PersistenceManager
{
PersistenceManager pers { get; set; }
}
}

@ -1,33 +0,0 @@
using Biblioteque_de_Class;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using System.Xml;
using System;
using System.Collections.Generic;
using System.Diagnostics;
namespace Notus_Persistance
{
public static class PersistenceManager
{
public static void SaveDatabaseData(Database database)
{
ToJSON.SaveDatabaseData(database);
}
public static Database LoadDatabaseData()
{
return ToJSON.LoadDatabaseData();
}
public static void SaveUserData(User user)
{
ToJSON.SaveUserData(user);
}
public static User LoadUserData()
{
return ToJSON.LoadUserData();
}
}
}

@ -4,31 +4,79 @@ using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization.Json;
using System.Text;
using System.Security.Cryptography;
using System.Threading.Tasks;
namespace Notus_Persistance
{
public class Stub
public class Stub : IManager
{
public static void SaveDatabaseData(Database database)
public void SaveDatabaseData(List<User> UserList)
{
throw new NotImplementedException();
}
public static Database LoadDatabaseData()
public void SaveDefaultData(List<Theme> DefaultThemeList, List<Logo> DefaultLogoList)
{
throw new NotImplementedException() ;
}
public static void SaveUserData(User user)
//Loaders
List<User> IManager.LoadDatabaseData()
{
List<User> userList = new List<User>();
Note nselect;
User uselect;
// add some users
userList.Add(new User("Nicolas", "leHeros@gmail.com", "FeurFeur"));
userList.Add(new User("Benjamin", "labsent@gmail.com", "Moto2005"));
userList.Add(new User("Liam", "liammonchanin@gmail.com", "Baguette"));
userList.Add(new User("Brigitte", "Macroutte@gmail.com", "4949Trois"));
// add some notes and tags to go faster
for (int i = 0; i < userList.Count; i++)
{
userList[i].CreateNote($"Note {i}", "DefaultLogo.png");
userList[i].CreateTag($"Tag {i}", "#5555FF");
}
// add note to user for sharing note test mixed with tag
uselect = userList[0];
nselect = uselect.NoteList[0];
nselect.AddCollaborator(uselect, userList[1]);
nselect.AddCollaborator(uselect, userList[2]);
uselect.AddTagFromNoteList(nselect, uselect.TagList[0]);
nselect.AddEditor(uselect, userList[2]);
// add some default logos and themes
foreach (User user in userList)
{
user.ChangePassword(user.Password);
}
return userList;
}
public static User LoadUserData()
public List<Theme> LoadDefaultTheme()
{
List<Theme> DefaultThemeList = new List<Theme>();
DefaultThemeList.Add(new("blacktheme", "#000000,#FF00FF,#OOFFOO".Split(',').ToList()));
DefaultThemeList.Add(new("whitetheme", "#FFFFFF,#FF00FF,#OOFFOO".Split(',').ToList()));
return DefaultThemeList;
}
public List<Logo> LoadDefaultLogo()
{
List<Logo> DefaultLogoList = new List<Logo>();
DefaultLogoList.Add(new("default","DefaultLogo.png"));
DefaultLogoList.Add(new("1", "Logo1.png"));
DefaultLogoList.Add(new("2", "Logo2.png"));
return DefaultLogoList;
}
}
}

@ -1,99 +0,0 @@
using Biblioteque_de_Class;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using System.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Text.Json;
namespace Notus_Persistance
{
public static class ToJSON
{
private const string DatabaseDataFilePath = "data.json";
private const string UserDataFilePath = "userdata.json";
private static DataContractJsonSerializer DatabasejsonSerializer = new DataContractJsonSerializer(typeof(Database));
private static DataContractJsonSerializer UserjsonSerializer = new DataContractJsonSerializer(typeof(User));
public static void SaveDatabaseData(Database database)
{
using (FileStream fileStream = File.Create(DatabaseDataFilePath))
{
using (var writer = JsonReaderWriterFactory.CreateJsonWriter(
fileStream,
System.Text.Encoding.UTF8,
false,
true))//<- this boolean says that we sant indentation
{
DatabasejsonSerializer.WriteObject(writer, database);
}
}
}
public static Database LoadDatabaseData()
{
if (File.Exists(DatabaseDataFilePath))
{
Database database1;
using (FileStream fileStream = File.OpenRead(DatabaseDataFilePath))
{
Database? database = (Database?)DatabasejsonSerializer.ReadObject(fileStream);
if (database == null)
{
throw new Exception("Failed to load database. The loaded object is null.");
}
else
{
return database1 = database;
}
}
}
else
{
throw new Exception("No data file found.");
}
}
public static void SaveUserData(User user)
{
using (FileStream fileStream = File.Create(UserDataFilePath))
{
using (var writer = JsonReaderWriterFactory.CreateJsonWriter(
fileStream,
System.Text.Encoding.UTF8,
false,
true))//<- this boolean says that we sant indentation
{
UserjsonSerializer.WriteObject(writer, user);
}
}
}
public static User LoadUserData()
{
if (File.Exists(UserDataFilePath))
{
User user1;
using (FileStream fileStream = File.OpenRead(UserDataFilePath))
{
User? user = (User?)UserjsonSerializer.ReadObject(fileStream);
if (user == null)
{
throw new Exception("Failed to load database. The loaded object is null.");
}
else
{
return user1 = user;
}
}
}
else
{
throw new Exception("No userfile find");
}
}
}
}

@ -1,38 +1,107 @@
using Biblioteque_de_Class;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using System.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Diagnostics.CodeAnalysis;
namespace Notus_Persistance
{
public static class ToXML
[ExcludeFromCodeCoverage]
public class ToXML : IManager
{
private const string DataFilePath = "data.xml";
private const string XmlDataFilePath = "userdata.xml";
// /../../../..
private string DataFilePath { get; set; } = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "NotusData");
private const string DataFileName = "/Userdata.xml";
private const string DefaultThemeName = "/defaultTheme.xml";
private const string DefaultLogoName = "/defaultLogo.xml";
private static readonly DataContractSerializer DatabaseXmlSerializer = new(typeof(Database), GetKnownTypes());
public static void SaveDatabaseData(Database database)
public void SaveDatabaseData(List<User> UserList)
{
if (!Directory.Exists(DataFilePath))
{
Directory.CreateDirectory(DataFilePath);
}
XmlWriterSettings settings = new() { Indent = true };
using TextWriter tw = File.CreateText(Path.Combine(DataFilePath + DataFileName));
using XmlWriter writer = XmlWriter.Create(tw, settings);
DatabaseXmlSerializer.WriteObject(writer, UserList);
}
public static Database LoadDatabaseData()
public void SaveDefaultData(List<Theme> DefaultThemeList, List<Logo> DefaultLogoList)
{
if (!Directory.Exists(DataFilePath))
{ Directory.CreateDirectory(DataFilePath); }
XmlWriterSettings settings = new() { Indent = true };
using TextWriter tw = File.CreateText(Path.Combine(DataFilePath + DefaultThemeName));
using XmlWriter writer = XmlWriter.Create(tw, settings);
DatabaseXmlSerializer.WriteObject(writer, DefaultThemeList);
using TextWriter tw2 = File.CreateText(Path.Combine(DataFilePath + DefaultLogoName));
using XmlWriter writer2 = XmlWriter.Create(tw2, settings);
DatabaseXmlSerializer.WriteObject(writer2, DefaultLogoList);
}
public static void SaveUserData(User user)
private static IEnumerable<Type> GetKnownTypes()
{
yield return typeof(User);
yield return typeof(List<User>);
yield return typeof(Theme);
yield return typeof(List<Theme>);
yield return typeof(Logo);
yield return typeof(List<Logo>);
}
public List<User> LoadDatabaseData()
{
if (File.Exists(Path.Combine(DataFilePath + DataFileName)))
{
using (FileStream fileStream = File.OpenRead(Path.Combine(DataFilePath + DataFileName)))
{
return DatabaseXmlSerializer.ReadObject(fileStream) is not List<User> user
? throw new FileException("Failed to load Database. The loaded object is null.")
: user;
}
}
else
{
throw new FileException("No data file found.");
}
}
public static User LoadUserData()
public List<Theme> LoadDefaultTheme()
{
if (File.Exists(Path.Combine(DataFilePath + DefaultThemeName)))
{
using (FileStream fileStream = File.OpenRead(Path.Combine(DataFilePath + DefaultThemeName)))
{
return DatabaseXmlSerializer.ReadObject(fileStream) is not List<Theme> DefaultThemeList
? throw new FileException("Failed to load Default Theme. The loaded object is null.")
: DefaultThemeList;
}
}
else
{
throw new FileException("No data file found.");
}
}
public List<Logo> LoadDefaultLogo()
{
if (File.Exists(Path.Combine(DataFilePath + DefaultLogoName)))
{
using (FileStream fileStream = File.OpenRead(Path.Combine(DataFilePath + DefaultLogoName)))
{
return DatabaseXmlSerializer.ReadObject(fileStream) is not List<Logo> DefaultLogoList
? throw new FileException("Failed to load Default Logo. The loaded object is null.")
: DefaultLogoList;
}
}
else
{
throw new FileException("No data file found.");
}
}
}
}

@ -1,39 +0,0 @@
using Biblioteque_de_Class;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
namespace Notus_UnitTest_Database
{
public class AddThemeTests
{
private Database database;
[SetUp]
public void Setup()
{
database = new Database();
}
[Test]
public void AddTheme_NewTheme_ThemeAddedToList()
{
List<string> listcolor = new List<string>() { "Blue", "Dark", "Grey" };
Theme theme = new Theme("ocean", listcolor);
database.AddTheme(theme);
CollectionAssert.Contains(database.GetThemeList(), theme);
}
[Test]
public void AddTheme_ExistingTheme_ThrowsException()
{
List<string> listcolor = new();
Theme theme = new Theme("ocean", listcolor);
database.GetThemeList().Add(theme);
Assert.Throws<Exception>(() => database.AddTheme(theme), "Theme already used.");
}
}
}

@ -1,51 +0,0 @@
using Biblioteque_de_Class;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Notus_UnitTest_Database
{
public class AddUserTests
{
private Database database;
[SetUp]
public void Setup()
{
database = new Database();
}
[Test]
public void AddUser_ValidUser_UserAddedToList()
{
User user = new User("John", "rien", "choco") ;
user.SetEmail("john@example.com");
database.AddUser(user);
CollectionAssert.Contains(database.GetUserList(), user);
}
[Test]
public void AddUser_DuplicateUsername_ThrowsException()
{
User existingUser = new User("John1", "rien", "choco");
existingUser.SetEmail("john1@example.com");
database.GetUserList().Add(existingUser);
User newUser = new User("John1", "rien", "choco");
newUser.SetEmail("Jane@example.com");
Assert.Throws<Exception>(() => database.AddUser(newUser), "Username already used.");
}
[Test]
public void AddUser_DuplicateEmail_ThrowsException()
{
User existingUser = new User("John2", "rien", "choco");
existingUser.SetEmail("john2@example.com");
database.GetUserList().Add(existingUser);
User newUser = new User("Jane", "rien", "choco");
newUser.SetEmail("john2@example.com");
Assert.Throws<Exception>(() => database.AddUser(newUser), "Email already used.");
}
}
}

@ -1,42 +0,0 @@
using Biblioteque_de_Class;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Notus_UnitTest_Database
{
[TestFixture]
public class ComparePasswordTests
{
private Database database;
[SetUp]
public void Setup()
{
database = new Database();
User user = new User("John","rien","choco");
user.SetPassword("password123");
database.GetUserList().Add(user);
}
[Test]
public void ComparePassword_CorrectPassword_ReturnsTrue()
{
User user = database.GetUserList()[0];
string password = "password123";
bool result = database.ComparePassword(user, password);
Assert.IsTrue(result);
}
[Test]
public void ComparePassword_IncorrectPassword_ReturnsFalse()
{
User user = database.GetUserList()[0];
string password = "incorrectPassword";
bool result = database.ComparePassword(user, password);
Assert.IsFalse(result);
}
}
}

@ -1,39 +0,0 @@
using Biblioteque_de_Class;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Notus_UnitTest_Database
{
public class FindMailTests
{
private Database database;
[SetUp]
public void Setup()
{
database = new Database();
User user = new User("John");
user.SetEmail("john@example.com");
database.GetUserList().Add(user);
}
[Test]
public void FindEmail_ExistingEmail_ReturnsTrue()
{
string email = "john@example.com";
bool result = database.FindEmail(email);
Assert.IsTrue(result);
}
[Test]
public void FindEmail_NonExistingEmail_ReturnsFalse()
{
string email = "jane@example.com";
bool result = database.FindEmail(email);
Assert.IsFalse(result);
}
}
}

@ -1,34 +0,0 @@
using Biblioteque_de_Class;
namespace Notus_UnitTest_Database
{
[TestFixture]
public class GetLogoLinksTests
{
private Database database;
[SetUp]
public void Setup()
{
database = new Database();
database.GetDefaultLogoList().Add(new Logo("Logo1", "link1"));
database.GetDefaultLogoList().Add(new Logo("Logo2", "link2"));
database.GetDefaultLogoList().Add(new Logo("Logo3", "link3"));
}
[Test]
public void GetLogoLink_LogoExists_ReturnsLogoLink()
{
string logoName = "Logo2";
string logoLink = database.GetLogoLink(logoName);
Assert.That(logoLink, Is.EqualTo("link2"));
}
[Test]
public void GetLogoLink_LogoDoesNotExist_ThrowsException()
{
string logoName = "Logo4";
Assert.Throws<Exception>(() => database.GetLogoLink(logoName));
}
}
}

@ -1,36 +0,0 @@
using Biblioteque_de_Class;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Notus_UnitTest_Database
{
public class GetThemeTests
{
private Database database;
[SetUp]
public void Setup()
{
database = new Database();
}
[Test]
public void GetTheme_ExistingTheme_ReturnsTheme()
{
List<string> listcolor = new List<string>() { "Blue", "Dark", "Grey" };
Theme theme = new Theme("ocean", listcolor);
database.GetThemeList().Add(theme);
Theme retrievedTheme = database.GetTheme("Dark");
Assert.That(retrievedTheme, Is.EqualTo(theme));
}
[Test]
public void GetTheme_NonExistingTheme_ThrowsException()
{
Assert.Throws<Exception>(() => database.GetTheme("NonExistingTheme"), "No theme found with this name.");
}
}
}

@ -1,36 +0,0 @@
using Biblioteque_de_Class;
namespace Notus_UnitTest_Database
{
[TestFixture]
public class GetUserTests
{
private Database database;
[SetUp]
public void Setup()
{
database = new Database();
database.GetUserList().Add(new User("John","rien","choco"));
database.GetUserList().Add(new User("Alice", "rien", "choco"));
database.GetUserList().Add(new User("Bob", "rien", "choco"));
}
[Test]
public void GetUser_UserExists_ReturnsUser()
{
string userName = "Alice";
User user = database.GetUser(userName);
Assert.IsNotNull(user);
Assert.That(user.GetUsername(), Is.EqualTo(userName));
}
[Test]
public void GetUser_UserDoesNotExist_ThrowsException()
{
string userName = "Eve";
Assert.Throws<Exception>(() => database.GetUser(userName));
}
}
}

@ -1,43 +0,0 @@
using Biblioteque_de_Class;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Notus_UnitTest_Database
{
public class ModifyThemeColorListTests
{
private Database database;
[SetUp]
public void Setup()
{
database = new Database();
}
[Test]
public void ModifyThemeColorList_ExistingTheme_ModifiesColors()
{
List<string> listcolor = new List<string>() { "Blue", "Dark", "Grey" };
Theme theme = new Theme("ocean", listcolor);
database.GetThemeList().Add(theme);
List<string> newColorList = new List<string> { "Red", "Green", "Blue" };
database.ModifyThemeColorList(theme, newColorList);
Assert.That(theme.GetColor(0), Is.EqualTo(newColorList[0]));
Assert.That(theme.GetColor(1), Is.EqualTo(newColorList[1]));
Assert.That(theme.GetColor(2), Is.EqualTo(newColorList[2]));
}
[Test]
public void ModifyThemeColorList_NonExistingTheme_ThrowsException()
{
List<string> listcolor = new List<string>() { "Blue", "Dark", "Grey" };
Theme theme = new Theme("ocean", listcolor);
// no add :)
List<string> newColorList = new List<string> { "Red", "Green", "Blue" };
Assert.Throws<Exception>(() => database.ModifyThemeColorList(theme, newColorList), "Theme not found.");
}
}
}

@ -1,36 +0,0 @@
using Biblioteque_de_Class;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Notus_UnitTest_Database
{
public class ModifyThemeNameTests
{
private Database database;
[SetUp]
public void Setup()
{
database = new Database();
}
[Test]
public void GetTheme_ExistingTheme_ReturnsTheme()
{
List<string> listcolor = new List<string>() { "Blue", "Dark", "Grey" };
Theme theme = new Theme("ocean", listcolor);
database.GetThemeList().Add(theme);
Theme retrievedTheme = database.GetTheme("Dark");
Assert.That(retrievedTheme, Is.EqualTo(theme));
}
[Test]
public void GetTheme_NonExistingTheme_ThrowsException()
{
Assert.Throws<Exception>(() => database.GetTheme("NonExistingTheme"), "No theme found with this name.");
}
}
}

@ -1,38 +0,0 @@
using Biblioteque_de_Class;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Notus_UnitTest_Database
{
public class RemoveUserTests
{
private Database database;
[SetUp]
public void Setup()
{
database = new Database();
}
[Test]
public void RemoveUser_ExistingUser_UserRemovedFromList()
{
User user = new User("John","rien","choco");
user.SetEmail("john@example.com");
database.GetUserList().Add(user);
database.RemoveUser(user);
CollectionAssert.DoesNotContain(database.GetUserList(), user);
}
[Test]
public void RemoveUser_NonExistingUser_ThrowsException()
{
User user = new User("John", "rien", "choco");
user.SetEmail("john@example.com");
Assert.Throws<Exception>(() => database.RemoveUser(user), "User not found.");
}
}
}

@ -1,54 +0,0 @@
using Biblioteque_de_Class;
namespace Notus_UnitTest_Database
{
[TestFixture]
public class SearchUserTests
{
private Database database;
[SetUp]
public void Setup()
{
database = new Database();
database.GetUserList().Add(new User("John", "john@example.com", "choco"));
database.GetUserList().Add(new User("Jane", "jane@example.com", "choco"));
database.GetUserList().Add(new User("Alice", "alice@example.com", "choco"));
}
[Test]
public void SearchUser_UserExists_ReturnsMatchingUsers()
{
string searchName = "Jo";
List<User> searchedUsers = database.SearchUser(searchName);
Assert.That(searchedUsers.Count, Is.EqualTo(1));
Assert.That(searchedUsers[0].GetUsername(), Is.EqualTo("John"));
}
[Test]
public void SearchUser_UserDoesNotExist_ReturnsEmptyList()
{
string searchName = "Bob";
List<User> searchedUsers = database.SearchUser(searchName);
Assert.IsEmpty(searchedUsers);
}
[Test]
public void SearchUser_CaseInsensitiveSearch_ReturnsMatchingUsers()
{
string searchName = "ALICE";
List<User> searchedUsers = database.SearchUser(searchName);
Assert.That(searchedUsers.Count, Is.EqualTo(1));
Assert.That(searchedUsers[0].GetUsername(), Is.EqualTo("Alice"));
}
[Test]
public void SearchUser_PartialMatch_ReturnsMatchingUsers()
{
string searchName = "ane";
List<User> searchedUsers = database.SearchUser(searchName);
Assert.That(searchedUsers.Count, Is.EqualTo(1));
Assert.That(searchedUsers[0].GetUsername(), Is.EqualTo("Jane"));
}
}
}

@ -0,0 +1,223 @@
using Biblioteque_de_Class;
namespace UnitTests_Model
{
[TestFixture]
public class Database_Tests
{
private Database database;
[SetUp]
public void Setup()
{
database = new Database();
database.UserList.Add(new User("John", "john@example.com", "password123"));
database.UserList.Add(new User("Jane", "jane@example.com", "choco"));
database.UserList.Add(new User("Alice", "alice@example.com", "choco"));
database.DefaultLogoList.Add(new Logo("Logo1", "link1"));
database.DefaultLogoList.Add(new Logo("Logo2", "link2"));
database.DefaultLogoList.Add(new Logo("Logo3", "link3"));
}
// SearchUser tests
[Test]
public void SearchUser_UserDoesNotExist_ThrowsException()
{
string searchName = "Bob";
Assert.Throws<NotFoundException>(() => database.SearchUser(searchName));
}
[Test]
public void SearchUser_CaseInsensitiveSearch_ReturnsMatchingUsers()
{
string searchName = "Alice";
User searchedUser = database.SearchUser(searchName);
Assert.That(searchedUser.Username, Is.EqualTo("Alice"));
}
// GetLogoLink tests
[Test]
public void GetLogoLink_LogoExists_ReturnsLogoLink()
{
Assert.That(database.GetLogoLink("Logo2"), Is.EqualTo("link2"));
}
[Test]
public void GetLogoLink_LogoDoesNotExist_ThrowsException()
{
string logoName = "Logo4";
Assert.Throws<NotFoundException>(() => database.GetLogoLink(logoName));
}
// GetUser tests
[Test]
public void GetUser_UserExists_ReturnsUser()
{
string userName = "Alice";
User user = database.GetUser(userName);
Assert.IsNotNull(user);
Assert.That(user.Username, Is.EqualTo(userName));
}
[Test]
public void GetUser_UserDoesNotExist_ThrowsException()
{
string userName = "Eve";
Assert.Throws<NotFoundException>(() => database.GetUser(userName));
}
// ComparePassword tests
[Test]
public void ComparePassword_CorrectPassword_ReturnsTrue()
{
User user = database.UserList[0];
string password = "password123";
bool result = Database.ComparePassword(user, password);
Assert.That(result, Is.True);
}
[Test]
public void ComparePassword_IncorrectPassword_ReturnsFalse()
{
User user = database.UserList[0];
string password = "incorrectPassword";
bool result = Database.ComparePassword(user, password);
Assert.That(result, Is.False);
}
// FindEmail tests
[Test]
public void FindEmail_ExistingEmail_ReturnsTrue()
{
string email = "john@example.com";
bool result = database.FindEmail(email);
Assert.IsTrue(result);
}
[Test]
public void FindEmail_NonExistingEmail_ReturnsFalse()
{
string email = "olivedecarglass@example.com";
bool result = database.FindEmail(email);
Assert.IsFalse(result);
}
// AddUser tests
[Test]
public void AddUser_ValidUser_AddsUserToList()
{
User user = new User("Bob", "bob@example.com", "password123");
database.AddUser(user);
Assert.That(database.UserList, Contains.Item(user));
}
[Test]
public void AddUser_DuplicateUserName_ThrowsException()
{
User user = new User("John", "johnDae@example.com", "password123");
Assert.Throws<AlreadyUsedException>(() => database.AddUser(user));
}
[Test]
public void AddUser_DuplicateUserEmail_ThrowsException()
{
User user = new User("Bob", "john@example.com", "password123");
Assert.Throws<AlreadyUsedException>(() => database.AddUser(user));
}
// removeUser tests
[Test]
public void RemoveUser_ExistingUser_RemovesUserFromList()
{
User user = database.UserList[0];
database.RemoveUser(user);
Assert.That(database.UserList, !Contains.Item(user));
}
[Test]
public void RemoveUser_NotExistingUser_ThrowsException()
{
User user = new User("Bob", "bob@example.com", "password123");
Assert.Throws<NotFoundException>(() => database.RemoveUser(user));
}
// AddTheme tests
[Test]
public void AddTheme_ValidTheme_AddsThemeToList()
{
Theme theme = new Theme("Theme1", ",,,".Split().ToList());
database.AddTheme(theme);
Assert.That(database.ThemeList, Contains.Item(theme));
}
[Test]
public void AddTheme_DuplicateTheme_ThrowsException()
{
Theme theme = new Theme("Theme1", ",,,".Split().ToList());
database.ThemeList.Add(theme);
Assert.Throws<AlreadyExistException>(() => database.AddTheme(theme));
}
// GetTheme tests
[Test]
public void GetTheme_ExistingTheme_ReturnsTheme()
{
Theme expectedTheme = new Theme("Theme1", ",,,".Split().ToList());
database.ThemeList.Add(expectedTheme);
Theme theme = database.GetTheme("Theme1");
Assert.IsNotNull(theme);
Assert.That(theme, Is.EqualTo(expectedTheme));
}
[Test]
public void GetTheme_NonExistingTheme_ReturnsNull()
{
Theme expectedTheme = new Theme("Theme1", ",,,".Split().ToList());
database.ThemeList.Add(expectedTheme);
Assert.Throws<NotFoundException>(() => database.GetTheme("NonExistingTheme"));
}
// ChangeUsername tests
[Test]
public void ChangeUsername_CorrectReplaceName_ChangesUsername()
{
User userSelected = database.UserList[0];
string newUsername = "duberlute";
database.ChangeUsername(userSelected, newUsername);
User updatedUser = database.UserList.Where(u => u.Username == newUsername).First();
Assert.IsNotNull(updatedUser);
Assert.That(updatedUser.Username, Is.EqualTo(newUsername));
}
[Test]
public void ChangeUsername_UsernameAlreadyUsed_ThrowsException()
{
User userNotSelected = database.UserList[2];
string newUsername = "Jane";
Assert.Throws<AlreadyUsedException>(() => database.ChangeUsername(userNotSelected, newUsername));
}
// VerifThemeNameNotTaken tests
[Test]
public void VerifThemeNameNotTaken_NameNotTaken_ReturnsTrue()
{
string themeName = "NewTheme";
bool result = database.VerifThemeNameNotTaken(themeName);
Assert.IsTrue(result);
}
[Test]
public void VerifThemeNameNotTaken_NameAlreadyTaken_ReturnsFalse()
{
Theme expectedTheme = new Theme("Theme1", ",,,".Split().ToList());
database.ThemeList.Add(expectedTheme);
string themeName = "Theme1";
bool result = database.VerifThemeNameNotTaken(themeName);
Assert.IsFalse(result);
}
}
}

@ -0,0 +1,265 @@
using Biblioteque_de_Class;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace UnitTests_Model
{
[TestFixture]
public class Note_Tests
{
private User owner;
private Note note;
[SetUp]
public void Setup()
{
owner = new User("John", "john@example.com", "password123");
note = new Note(1, "Note 1", "logoPath", owner);
}
[Test]
public void Note_Constructor_InitializesProperties()
{
Assert.That(note.id, Is.EqualTo(1));
Assert.That(note.Name, Is.EqualTo("Note 1"));
Assert.That(note.LogoPath, Is.EqualTo("logoPath"));
Assert.That(note.Owner, Is.EqualTo(owner));
Assert.That(note.ImageList.Count, Is.EqualTo(0));
Assert.That(note.Collaborators.Count, Is.EqualTo(0));
Assert.That(note.Editors.Count, Is.EqualTo(1));
Assert.That(note.Editors[0], Is.EqualTo(owner));
}
[Test]
public void Note_VerifyOwner_UserIsOwner_ReturnsTrue()
{
bool result = note.VerifyOwner(owner);
Assert.IsTrue(result);
}
[Test]
public void Note_VerifyOwner_UserIsNotOwner_ThrowsNotAllowedException()
{
User otherUser = new User("Jane", "jane@example.com", "password123");
Assert.Throws<NotAllowedException>(() => note.VerifyOwner(otherUser));
}
[Test]
public void Note_AddImage_ValidData_AddsImage()
{
string imageLink = "imageLink";
List<int> position = new List<int> { 1, 2, 3 };
note.AddImage(imageLink, position);
Assert.That(note.ImageList.Count, Is.EqualTo(1));
Assert.That(note.ImageList[0].Name, Is.EqualTo("1"));
Assert.That(note.ImageList[0].ImageLink, Is.EqualTo(imageLink));
Assert.That(note.ImageList[0].Position, Is.EqualTo(position));
}
[Test]
public void Note_RemoveImage_ExistingImage_RemovesImage()
{
string imageLink = "imageLink";
List<int> position = new List<int> { 1, 2, 3 };
note.AddImage(imageLink, position);
note.RemoveImage("1");
Assert.That(note.ImageList.Count, Is.EqualTo(0));
}
[Test]
public void Note_RemoveImage_NonExistingImage_ThrowsNotFoundException()
{
string imageLink = "imageLink";
List<int> position = new List<int> { 1, 2, 3 };
note.AddImage(imageLink, position);
Assert.Throws<NotFoundException>(() => note.RemoveImage("2"));
}
[Test]
public void Note_AddText_UserIsOwner_AddsText()
{
User user = owner;
string text = "Some text";
note.AddText(user, text);
Assert.That(note.Text, Is.EqualTo("\n" + text));
Assert.That(note.ModificationDate, Is.EqualTo(DateOnly.FromDateTime(DateTime.Now)));
}
[Test]
public void Note_AddText_UserIsEditor_AddsText()
{
User user = new User("Editor", "editor@example.com", "password123");
note.AddEditor(owner, user);
string text = "Some text";
note.AddText(user, text);
Assert.That(note.Text, Is.EqualTo("\n"+text));
Assert.That(note.ModificationDate, Is.EqualTo(DateOnly.FromDateTime(DateTime.Now)));
}
[Test]
public void Note_AddText_UserIsNotOwnerOrEditor_ThrowsNotAllowedException()
{
User user = new User("Jane", "jane@example.com", "password123");
string text = "Some text";
Assert.Throws<NotAllowedException>(() => note.AddText(user, text));
}
[Test]
public void Note_VerifyPrivilege_UserIsEditor_ReturnsTrue()
{
User editor = new User("Editor", "editor@example.com", "password123");
note.AddEditor(owner, editor);
bool result = note.VerifyPrivilege(editor);
Assert.IsTrue(result);
}
[Test]
public void Note_VerifyPrivilege_UserIsNotEditor_ReturnsFalse()
{
User user = new User("User", "user@example.com", "password123");
bool result = note.VerifyPrivilege(user);
Assert.IsFalse(result);
}
[Test]
public void Note_AddCollaborator_UserIsOwner_AddsCollaborator()
{
User collaborator = new User("Collaborator", "collaborator@example.com", "password123");
note.AddCollaborator(owner, collaborator);
Assert.That(note.Collaborators.Count, Is.EqualTo(1));
Assert.That(note.Collaborators[0], Is.EqualTo(collaborator));
Assert.IsTrue(collaborator.NoteList.Contains(note));
}
[Test]
public void Note_AddCollaborator_UserIsNotOwner_ThrowsNotAllowedException()
{
User otherUser = new User("OtherUser", "otheruser@example.com", "password123");
User collaborator = new User("Collaborator", "collaborator@example.com", "password123");
Assert.Throws<NotAllowedException>(() => note.AddCollaborator(otherUser, collaborator));
}
[Test]
public void Note_RemoveCollaborator_UserIsOwner_RemovesCollaborator()
{
User collaborator = new User("Collaborator", "collaborator@example.com", "password123");
note.AddCollaborator(owner, collaborator);
note.RemoveCollaborator(owner, collaborator);
Assert.That(note.Collaborators.Count, Is.EqualTo(0));
Assert.IsFalse(collaborator.NoteList.Contains(note));
}
[Test]
public void Note_RemoveCollaborator_UserIsNotOwner_ThrowsNotAllowedException()
{
User otherUser = new User("OtherUser", "otheruser@example.com", "password123");
User collaborator = new User("Collaborator", "collaborator@example.com", "password123");
note.AddCollaborator(owner, collaborator);
Assert.Throws<NotAllowedException>(() => note.RemoveCollaborator(otherUser, collaborator));
}
[Test]
public void Note_AddEditor_UserAlreadyEditor_ThrowsAlreadyExistException()
{
User editor = new User("Editor", "editor@example.com", "password123");
note.AddEditor(owner, editor);
Assert.Throws<AlreadyExistException>(() => note.AddEditor(owner, editor));
}
[Test]
public void Note_AddEditor_UserIsOwner_AddsEditor()
{
User editor = new User("Editor", "editor@example.com", "password123");
note.AddEditor(owner, editor);
Assert.That(note.Editors.Count, Is.EqualTo(2));
Assert.That(note.Editors[1], Is.EqualTo(editor));
}
[Test]
public void Note_RemoveEditor_UserNotEditor_ThrowsNotFoundException()
{
User user = new User("User", "user@example.com", "password123");
Assert.Throws<NotFoundException>(() => note.RemoveEditor(owner, user));
}
[Test]
public void Note_RemoveEditor_UserIsOwner_RemovesEditor()
{
User editor = new User("Editor", "editor@example.com", "password123");
note.AddEditor(owner, editor);
note.RemoveEditor(owner, editor);
Assert.That(note.Editors.Count, Is.EqualTo(1));
Assert.IsFalse(note.Editors.Contains(editor));
}
[Test]
public void Note_ChangeName_UserIsOwner_ChangesName()
{
User user = owner;
string newName = "New Note Name";
note.ChangeName(user, newName);
Assert.That(note.Name, Is.EqualTo(newName));
}
[Test]
public void Note_ChangeName_UserIsNotOwner_NameNotChanged()
{
User user = new User("OtherUser", "otheruser@example.com", "password123");
string newName = "New Note Name";
Assert.Throws<NotAllowedException>(() => note.ChangeName(user, newName));
}
[Test]
public void Note_ChangeLogo_UserIsOwner_ChangesLogo()
{
User user = owner;
string newLogoPath = "newLogoPath";
note.ChangeLogo(user, newLogoPath);
Assert.That(note.LogoPath, Is.EqualTo(newLogoPath));
}
[Test]
public void Note_ChangeLogo_UserIsNotOwner_LogoNotChanged()
{
User user = new User("OtherUser", "otheruser@example.com", "password123");
string newLogoPath = "newLogoPath";
Assert.Throws<NotAllowedException>(() => note.ChangeLogo(user, newLogoPath));
}
}
}

@ -0,0 +1,481 @@
using Biblioteque_de_Class;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace UnitTests_Model
{
public class User_Tests
{
private User user;
[SetUp]
public void Setup()
{
user = new User("John", "john@example.com", "password123");
user.CreateTag("tag1","#FF0000");
user.CreateTag("tag2", "#00FF00");
user.CreateNote("note1", "default.png");
user.AddTagFromNoteList(user.NoteList[0], user.TagList[0]);
user.CreateNote("note2", "default.png");
user.AddTheme(new Theme("white","#FFAAAA,#000000,#999999".Split(',').ToList()));
}
//test searchnoteByName
[Test]
public void User_SearchNoteByName_ValidData_ReturnsNote()
{
Note note = user.SearchNoteByName(user.NoteList,"note1").First();
Assert.That(note.Name, Is.EqualTo("note1"));
}
[Test]
public void User_SearchNoteByName_InvalidData_ReturnsNull()
{
Assert.That(user.SearchNoteByName(user.NoteList, "note3"), Is.Empty);
}
//test seachNoteBytag
[Test]
public void User_SearchNoteByTag_ValidData_ReturnsNote()
{
Note note = user.SearchNoteByTag(user.NoteList, "tag1").First();
Assert.That(note.Name, Is.EqualTo("note1"));
}
[Test]
public void User_SearchNoteByTag_InvalidData_ReturnsNull()
{
Assert.Throws<NotFoundException>(() => user.SearchNoteByTag(user.NoteList, "tag3"));
}
//test SearchNoteByDate
[Test]
public void User_SearchNoteByDate_ValidData_ReturnsNote()
{
Note note = user.SearchNoteByDate(user.NoteList, "note1", DateOnly.FromDateTime(DateTime.Now), DateOnly.FromDateTime(DateTime.Now)).First();
Assert.That(note.Name, Is.EqualTo("note1"));
}
[Test]
public void User_SearchNoteByDate_InvalidData_ReturnsNull()
{
Assert.That(user.SearchNoteByDate(user.NoteList, "note3", DateOnly.FromDateTime(DateTime.Now), DateOnly.FromDateTime(DateTime.Now)), Is.Empty);
}
//test GetNoteByName
[Test]
public void User_GetNoteByName_ValidData_ReturnsNote()
{
Note note = user.GetNoteByName("note1");
Assert.That(note.Name, Is.EqualTo("note1"));
}
[Test]
public void User_GetNoteByName_InvalidData_ReturnsNull()
{
Assert.Throws<NotFoundException>(() => user.GetNoteByName("note3"));
}
//test searchTagByName
[Test]
public void User_SearchTagByName_ValidData_ReturnsTag()
{
Tags tag = user.SearchTagByName(user.TagList, "tag1").First();
Assert.That(tag.Name, Is.EqualTo("tag1"));
}
[Test]
public void User_SearchTagByName_InvalidData_ReturnsNull()
{
Assert.That(user.SearchTagByName(user.TagList, "tag3"), Is.Empty);
}
//test AddFavorite
[Test]
public void User_AddFavorite_ValidData_AddNote()
{
user.AddFavorite(user.NoteList[0]);
Assert.That(user.FavList.Count, Is.EqualTo(1));
}
[Test]
public void User_AddFavorite_InvalidData_ThrowException()
{
user.AddFavorite(user.NoteList[0]);
Assert.Throws<AlreadyExistException>(() => user.AddFavorite(user.NoteList[0]));
}
//test RemoveFavorite
[Test]
public void User_RemoveFavorite_ValidData_RemoveNote()
{
user.AddFavorite(user.NoteList[0]);
user.RemoveFavorite(user.NoteList[0]);
Assert.That(user.FavList, Is.Empty);
}
[Test]
public void User_RemoveFavorite_InvalidData_ThrowException()
{
Assert.Throws<NotFoundException>(() => user.RemoveFavorite(user.NoteList[0]));
}
//test createNote
[Test]
public void User_CreateNote_ValidData_AddNote()
{
user.CreateNote("note3", "default.png");
Assert.That(user.NoteList.Count, Is.EqualTo(3));
}
[Test]
public void User_CreateNote_InvalidData_ThrowException()
{
user.CreateNote("note3", "default.png");
Assert.Throws<AlreadyExistException>(() => user.CreateNote("note3", "default.png"));
}
[Test]
public void User_CreateNote_ValidData_secondNote_AddNote()
{
User user2 = new User("John", "rien", "choco");
user2.CreateNote("note3", "default.png");
user2.CreateNote("note4", "default.png");
Assert.That(user2.NoteList.Count, Is.EqualTo(2));
Assert.That(user2.NoteList[1].id, Is.EqualTo(1));
}
//test DeleteNote
[Test]
public void User_DeleteNote_ValidData_RemoveNote()
{
Note note = user.NoteList[0];
user.DeleteNote(note);
Assert.That(user.NoteList.Count, Is.EqualTo(1));
}
[Test]
public void User_DeleteNote_InvalidData_ThrowException()
{
Note note = user.NoteList[0];
user.DeleteNote(note);
Assert.Throws<NotFoundException>(() => user.DeleteNote(note));
}
//test CreateTag
[Test]
public void User_CreateTag_ValidData_AddTag()
{
user.CreateTag("tag3", "#FF0000");
Assert.That(user.TagList.Count, Is.EqualTo(3));
}
[Test]
public void User_CreateTag_InvalidData_ThrowException()
{
user.CreateTag("tag3", "#FF0000");
Assert.Throws<AlreadyExistException>(() => user.CreateTag("tag2", "#FF0000"));
}
//test DeleteTag
[Test]
public void User_DeleteTag_ValidData_RemoveTag()
{
Tags tag = user.TagList[0];
user.DeleteTag(tag);
Assert.That(user.TagList.Count, Is.EqualTo(1));
}
[Test]
public void User_DeleteTag_InvalidData_ThrowException()
{
Tags tag = user.TagList[0];
user.DeleteTag(tag);
Assert.Throws<NotFoundException>(() => user.DeleteTag(tag));
}
//test EditTagName
[Test]
public void User_EditTagName_ValidData_EditTag()
{
user.EditTagName(user.TagList[0], "tag3");
Assert.That(user.TagList[0].Name, Is.EqualTo("tag3"));
}
[Test]
public void User_EditTagName_InvalidData_ThrowException()
{
Tags tags = new Tags("tag2", "#FF0000");
Assert.Throws<NotFoundException>(() => user.EditTagName(tags, "tag1"));
}
[Test]
public void User_EditTagName_InvalidData2_ThrowException()
{
Assert.Throws<AlreadyExistException>(() => user.EditTagName(user.TagList[0], "tag1"));
}
//test EditTagColor
[Test]
public void User_EditTagColor_ValidData_EditTag()
{
user.EditTagColor(user.TagList[0], "#FF0000");
Assert.That(user.TagList[0].Color, Is.EqualTo("#FF0000"));
}
[Test]
public void User_EditTagColor_InvalidData_ThrowException()
{
Tags tags = new Tags("tag2", "#FF0000");
Assert.Throws<NotFoundException>(() => user.EditTagColor(tags, "#000000"));
}
//Test AddTagFromNoteList
[Test]
public void User_AddTagFromNoteList_ValidData_AddTag()
{
user.AddTagFromNoteList(user.NoteList[0], user.TagList[1]);
Assert.That(user.NoteTagged[user.NoteList[0]].Count, Is.EqualTo(2));
}
[Test]
public void User_AddTagFromNoteList_InvalidData_ThrowException()
{
Tags tags = new Tags("tag2", "#FF0000");
Assert.Throws<NotFoundException>(() => user.AddTagFromNoteList(user.NoteList[0], tags));
}
[Test]
public void User_AddTagFromNoteList_InvalidData2_ThrowException()
{
User uvide = new User("", "", "");
Note note = new Note(4,"rien", "default.png", uvide);
Assert.Throws<NotFoundException>(() => user.AddTagFromNoteList(note, user.TagList[0]));
}
//Test RemoveTagFromNoteList
[Test]
public void User_RemoveTagFromNoteList_ValidData_RemoveTag()
{
user.RemoveTagFromNoteList(user.NoteList[0], user.TagList[0]);
Assert.That(user.NoteTagged[user.NoteList[0]], Is.Empty);
}
[Test]
public void User_RemoveTagFromNoteList_InvalidData_ThrowException()
{
Tags tags = new Tags("tag2", "#FF0000");
Assert.Throws<NotFoundException>(() => user.RemoveTagFromNoteList(user.NoteList[0], tags));
}
[Test]
public void User_RemoveTagFromNoteList_InvalidData2_ThrowException()
{
User uvide = new User("", "", "");
Note note = new Note(4, "rien", "default.png", uvide);
Assert.Throws<NotFoundException>(() => user.RemoveTagFromNoteList(note, user.TagList[0]));
}
//test SetNoteName
[Test]
public void User_SetNoteName_ValidData_EditNote()
{
user.SetNoteName(user.NoteList[0], "note3");
Assert.That(user.NoteList[0].Name, Is.EqualTo("note3"));
}
[Test]
public void User_SetNoteName_InvalidData_ThrowException()
{
User uvide = new User("", "", "");
Note note = new Note(4, "rien", "default.png", uvide);
Assert.Throws<NotFoundException>(() => user.SetNoteName(note, "note2"));
}
[Test]
public void User_SetNoteName_InvalidData2_ThrowException()
{
Assert.Throws<AlreadyUsedException>(() => user.SetNoteName(user.NoteList[0], "note1"));
}
//test ChangePassword
[Test]
public void User_ChangePassword_ValidData_ChangePassword()
{
user.ChangePassword("chocoChoco");
Assert.That(user.Password, Is.EqualTo(HashCodeModel.GetSHA256Hash("chocoChoco").ToString()));
}
[Test]
public void User_ChangePassword_InvalidData_ThrowException()
{
user.ChangePassword("chocoChoco");
Assert.Throws<AlreadyUsedException>(() => user.ChangePassword("chocoChoco"));
}
[Test]
public void User_ChangePassword_InvalidData1_ThrowException()
{
Assert.Throws<NotAllowedException>(() => user.ChangePassword("choco"));
}
[Test]
public void User_ChangePassword_InvalidData2_ThrowException()
{
Assert.Throws<NotAllowedException>(() => user.ChangePassword(""));
}
//test ChangeTheme
[Test]
public void User_ChangeTheme_ValidData_ChangeTheme()
{
user.ChangeTheme(new Theme("dark", "#0000FF,#FF00FF,#FFFFFF".Split(',').ToList()));
Assert.That(user.UseTheme.Name, Is.EqualTo("dark"));
}
[Test]
public void User_ChangeTheme_InvalidData_ThrowException()
{
user.ChangeTheme(new Theme("dark", "#0000FF,#FF00FF,#FFFFFF".Split(',').ToList()));
Assert.Throws<AlreadyExistException>(() => user.ChangeTheme(new Theme("dark", "#0000FF,#FF00FF,#FFFFFF".Split(',').ToList())));
}
//test ChangeThemeName
[Test]
public void User_ChangeThemeName_ValidData_ChangeThemeName()
{
user.ChangeThemeName(user.AddedTheme[0], "dark");
Assert.That(user.AddedTheme[0].Name, Is.EqualTo("dark"));
}
[Test]
public void User_ChangeThemeName_InvalidData_ThrowException()
{
user.AddTheme(new Theme("dark", "#0000FF,#FF00FF,#FFFFFF".Split(',').ToList()));
Assert.Throws<AlreadyExistException>(() => user.ChangeThemeName(user.AddedTheme[0], "dark"));
}
[Test]
public void User_ChangeThemeName_InvalidData2_ThrowException()
{
Assert.Throws<AlreadyExistException>(() => user.ChangeThemeName(user.AddedTheme[0], "white"));
}
//test ChangeThemeColors
[Test]
public void User_ChangeThemeColors_ValidData_ChangeThemeColors()
{
// Arrange
var theme = new Theme("blacktheme", new List<string> { "#000000", "#FF00FF", "#OOFFOO" });
var newColors = new List<string> { "#111111", "#222222", "#333333" };
// Act
user.ChangeThemeColors(theme, newColors);
// Assert
Assert.That(theme.ColorList[0], Is.EqualTo(newColors[0]));
Assert.That(theme.ColorList[1], Is.EqualTo(newColors[1]));
Assert.That(theme.ColorList[2], Is.EqualTo(newColors[2]));
}
[Test]
public void User_ChangeThemeColors_InvalidData_ThrowException()
{
// Arrange
var theme = new Theme("blacktheme", new List<string> { "#000000", "#FF00FF", "#OOFFOO" });
var sameColors = new List<string> { "#000000", "#FF00FF", "#OOFFOO" };
// Act & Assert
Assert.Throws<AlreadyExistException>(() => user.ChangeThemeColors(theme, sameColors));
}
[Test]
public void User_ChangeThemeColors_InvalidData1_ThrowException()
{
// Arrange
var theme = new Theme("blacktheme", new List<string> { "#000000", "#FF00FF", "#OOFFOO" });
var differentColors = new List<string> { "#111111", "#222222", "#333333", "#444444" };
// Act & Assert
Assert.Throws<NotFoundException>(() => user.ChangeThemeColors(theme, differentColors));
}
//test AddTheme
[Test]
public void User_AddTheme_ValidData_AddTheme()
{
user.AddTheme(new Theme("dark", "#0000FF,#FF00FF,#FFFFFF".Split(',').ToList()));
Assert.That(user.AddedTheme[1].Name, Is.EqualTo("dark"));
}
[Test]
public void User_AddTheme_InvalidData_ThrowException()
{
user.AddTheme(new Theme("dark", "#0000FF,#FF00FF,#FFFFFF".Split(',').ToList()));
Assert.Throws<AlreadyExistException>(() => user.AddTheme(new Theme("dark", "#0000FF,#FF00FF,#FFFFFF".Split(',').ToList())));
}
//test RemoveTheme
[Test]
public void User_RemoveTheme_ValidData_RemoveTheme()
{
user.AddTheme(new Theme("dark", "#0000FF,#FF00FF,#FFFFFF".Split(',').ToList()));
user.RemoveTheme(user.AddedTheme[1]);
Assert.That(user.AddedTheme.Count, Is.EqualTo(1));
}
[Test]
public void User_RemoveTheme_InvalidData_ThrowException()
{
Assert.Throws<NotFoundException>(() => user.RemoveTheme(new Theme("dark", "#0000FF,#FF00FF,#FFFFFF".Split(',').ToList())));
}
//test GetTheme
[Test]
public void User_GetTheme_ValidData_GetTheme()
{
user.AddTheme(new Theme("dark", "#0000FF,#FF00FF,#FFFFFF".Split(',').ToList()));
Assert.That(user.GetTheme("dark").Name, Is.EqualTo("dark"));
}
[Test]
public void User_GetTheme_InvalidData_ThrowException()
{
Assert.Throws<NotFoundException>(() => user.GetTheme("dark"));
}
//test ChangeEmail
[Test]
public void User_ChangeEmail_ValidData_ChangeEmail()
{
user.ChangeEmail("nouvelleEmail@gmail.com");
Assert.That(user.Email, Is.EqualTo("nouvelleEmail@gmail.com"));
}
[Test]
public void User_ChangeEmail_InvalidData_ThrowException()
{
Assert.Throws<NotAllowedException>(() => user.ChangeEmail(""));
}
//test ChangeProfilePicture
[Test]
public void User_ChangeProfilePicture_ValidData_ChangeProfilePicture()
{
user.ChangeProfilePicture("nouvellePhoto.png");
Assert.That(user.Picture, Is.EqualTo("nouvellePhoto.png"));
}
[Test]
public void User_ChangeProfilePicture_InvalidData_ThrowException()
{
Assert.Throws<NotFoundException>(() => user.ChangeProfilePicture("photosansextesion"));
}
[Test]
public void User_ChangeProfilePicture_InvalidData2_ThrowException()
{
user.ChangeProfilePicture("");
Assert.That(user.Picture, Is.EqualTo("default.png"));
}
}
}

@ -0,0 +1,76 @@
using Biblioteque_de_Class;
using Notus_Persistance;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace UnitTests_Persistance
{
public class Stub_Tests
{
PersistenceManager manager;
Database result;
[SetUp]
public void Setup()
{
manager = new PersistenceManager(new Stub());
result = new Database();
}
[Test]
public void SaveDatabaseData_Test()
{
Assert.Throws<NotImplementedException>(() => manager.SaveDatabaseData(result));
}
[Test]
public void LoadDatabaseData_Test()
{
result = manager.GetOnlyDatabaseUser();
Assert.NotNull(result);
Assert.NotNull(result.UserList);
Assert.That(result.UserList.Count, Is.EqualTo(4));
User user1 = result.UserList[0];
Assert.That(user1.Username, Is.EqualTo("Nicolas"));
Assert.That(user1.Email, Is.EqualTo("leHeros@gmail.com"));
Assert.That(user1.Password, Is.EqualTo(HashCodeModel.GetSHA256Hash("FeurFeur")));
Note user1Note = user1.NoteList[0];
Tags user1Tag = user1.TagList[0];
Assert.That(user1Note.Name, Is.EqualTo("Note 0"));
Assert.That(user1Note.LogoPath, Is.EqualTo("DefaultLogo.png"));
Assert.That(user1Tag.Name, Is.EqualTo("Tag 0"));
Assert.That(user1Tag.Color, Is.EqualTo("#5555FF"));
}
[Test]
public void LoadDefaultTheme_Test()
{
result = manager.GetOnlyDatabaseDefaultTheme();
Assert.NotNull(result);
Assert.That(result.ThemeList.Count, Is.EqualTo(2));
Theme theme1 = result.ThemeList[0];
Assert.That(theme1.Name, Is.EqualTo("blacktheme"));
Assert.That(theme1.ColorList[0], Is.EqualTo("#000000"));
Assert.That(theme1.ColorList[1], Is.EqualTo("#FF00FF"));
Assert.That(theme1.ColorList[2], Is.EqualTo("#OOFFOO"));
}
[Test]
public void LoadDefaultLogo_Test()
{
result = manager.GetOnlyDatabaseDefaultLogo();
Assert.NotNull(result);
Assert.That(result.DefaultLogoList.Count, Is.EqualTo(3));
Logo logo1 = result.DefaultLogoList[0];
Assert.That(logo1.Name, Is.EqualTo("default"));
Assert.That(logo1.LogoLink, Is.EqualTo("DefaultLogo.png"));
}
}
}

@ -0,0 +1,115 @@
using Biblioteque_de_Class;
using Notus_Persistance;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace UnitTests_Persistance
{
public class ToXML_Tests
{
PersistenceManager manager;
Database result;
[SetUp]
public void Setup()
{
manager = new PersistenceManager(new Stub());
result = new Database();
}
[Test]
public void SaveDatabaseData_Test()
{
PersistenceManager manager2 = new PersistenceManager(new ToXML());
Database result2 = manager.LoadDatabaseData();
manager2.SaveDatabaseData(result2);
Database result3 = manager2.GetOnlyDatabaseUser();
Assert.NotNull(result3);
Assert.That(result2.UserList.Count, Is.EqualTo(result3.UserList.Count));
Assert.That(result2.UserList[0].Username, Is.EqualTo(result3.UserList[0].Username));
Assert.That(result2.UserList[0].Email, Is.EqualTo(result3.UserList[0].Email));
Assert.That(result2.UserList[0].Password, Is.EqualTo(result3.UserList[0].Password));
}
[Test]
public void LoadDefaultData_Test()
{
PersistenceManager manager2 = new PersistenceManager(new ToXML());
Database result2 = new();
result2.SetDefaultThemeList(manager.GetOnlyDatabaseDefaultTheme().ThemeList);
result2.SetDefaultLogoList(manager.GetOnlyDatabaseDefaultLogo().DefaultLogoList);
manager2.SaveDefaultData(result2);
Database result3 = new();
result3.SetDefaultThemeList(manager2.GetOnlyDatabaseDefaultTheme().ThemeList);
result3.SetDefaultLogoList(manager2.GetOnlyDatabaseDefaultLogo().DefaultLogoList);
Assert.NotNull(result3);
Assert.That(result2.ThemeList.Count, Is.EqualTo(result3.ThemeList.Count));
Assert.That(result2.DefaultLogoList.Count, Is.EqualTo(result3.DefaultLogoList.Count));
Assert.That(result2.ThemeList[0].Name, Is.EqualTo(result3.ThemeList[0].Name));
Assert.That(result2.ThemeList[0].ColorList[0], Is.EqualTo(result3.ThemeList[0].ColorList[0]));
Assert.That(result2.ThemeList[0].ColorList[1], Is.EqualTo(result3.ThemeList[0].ColorList[1]));
Assert.That(result2.ThemeList[0].ColorList[2], Is.EqualTo(result3.ThemeList[0].ColorList[2]));
Assert.That(result2.DefaultLogoList[0].Name, Is.EqualTo(result3.DefaultLogoList[0].Name));
Assert.That(result2.DefaultLogoList[0].LogoLink, Is.EqualTo(result3.DefaultLogoList[0].LogoLink));
}
[Test]
public void LoadDatabaseData_Test()
{
result = manager.GetOnlyDatabaseUser();
Assert.NotNull(result);
Assert.NotNull(result.UserList);
Assert.That(result.UserList.Count, Is.EqualTo(4));
User user1 = result.UserList[0];
Assert.That(user1.Username, Is.EqualTo("Nicolas"));
Assert.That(user1.Email, Is.EqualTo("leHeros@gmail.com"));
Assert.That(user1.Password, Is.EqualTo(HashCodeModel.GetSHA256Hash("FeurFeur")));
Note user1Note = user1.NoteList[0];
Tags user1Tag = user1.TagList[0];
Assert.That(user1Note.Name, Is.EqualTo("Note 0"));
Assert.That(user1Note.LogoPath, Is.EqualTo("DefaultLogo.png"));
Assert.That(user1Tag.Name, Is.EqualTo("Tag 0"));
Assert.That(user1Tag.Color, Is.EqualTo("#5555FF"));
}
[Test]
public void LoadDefaultTheme_Test()
{
result = manager.GetOnlyDatabaseDefaultTheme();
Assert.NotNull(result);
Assert.That(result.ThemeList.Count, Is.EqualTo(2));
Theme theme1 = result.ThemeList[0];
Assert.That(theme1.Name, Is.EqualTo("blacktheme"));
Assert.That(theme1.ColorList[0], Is.EqualTo("#000000"));
Assert.That(theme1.ColorList[1], Is.EqualTo("#FF00FF"));
Assert.That(theme1.ColorList[2], Is.EqualTo("#OOFFOO"));
}
[Test]
public void LoadDefaultLogo_Test()
{
result = manager.GetOnlyDatabaseDefaultLogo();
Assert.NotNull(result);
Assert.That(result.DefaultLogoList.Count, Is.EqualTo(3));
Logo logo1 = result.DefaultLogoList[0];
Assert.That(logo1.Name, Is.EqualTo("default"));
Assert.That(logo1.LogoLink, Is.EqualTo("DefaultLogo.png"));
}
}
}

@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2" />
<PackageReference Include="NUnit.Analyzers" Version="3.6.1" />
<PackageReference Include="coverlet.collector" Version="3.2.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Biblioteque_de_Class\Biblioteque_de_Class.csproj" />
<ProjectReference Include="..\..\Notus_Persistence\Notus_Persistance.csproj" />
</ItemGroup>
</Project>

@ -0,0 +1 @@
global using NUnit.Framework;

@ -4,6 +4,13 @@ Microsoft Visual Studio Solution File, Format Version 12.00
VisualStudioVersion = 17.0.31611.283
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Notus_Vue", "notus_vue\Notus_Vue.csproj", "{561264A1-4611-40FB-A662-3EF65550CA71}"
ProjectSection(ProjectDependencies) = postProject
{184478A9-E14F-42E0-B963-B3A4474C9C1C} = {184478A9-E14F-42E0-B963-B3A4474C9C1C}
{7B7F1062-9498-44E5-AC77-84BC90A3B730} = {7B7F1062-9498-44E5-AC77-84BC90A3B730}
{92DD50C5-EEAD-44ED-AEFF-E21935725477} = {92DD50C5-EEAD-44ED-AEFF-E21935725477}
{AFCEAA99-3A25-4E9E-B498-72DD76A6B7FF} = {AFCEAA99-3A25-4E9E-B498-72DD76A6B7FF}
{EE443C17-B31D-4AD0-9141-920876E7DF79} = {EE443C17-B31D-4AD0-9141-920876E7DF79}
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Biblioteque_de_Class", "Biblioteque_de_Class\Biblioteque_de_Class.csproj", "{92DD50C5-EEAD-44ED-AEFF-E21935725477}"
EndProject
@ -11,7 +18,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Notus_Console", "Notus_Cons
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Notus_Persistance", "Notus_Persistence\Notus_Persistance.csproj", "{184478A9-E14F-42E0-B963-B3A4474C9C1C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Notus_UnitTest_Database", "Tests\Notus_UnitTest_Database\Notus_UnitTest_Database.csproj", "{EE443C17-B31D-4AD0-9141-920876E7DF79}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests_Model", "Tests\UnitTests_Model\UnitTests_Model.csproj", "{CB4664CE-F451-401D-862F-4A74A80B8161}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests_Persistance", "Tests\UnitTests_Persistance\UnitTests_Persistance.csproj", "{E2BCA278-8741-4116-B0E0-B20849D66739}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -37,10 +46,14 @@ Global
{184478A9-E14F-42E0-B963-B3A4474C9C1C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{184478A9-E14F-42E0-B963-B3A4474C9C1C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{184478A9-E14F-42E0-B963-B3A4474C9C1C}.Release|Any CPU.Build.0 = Release|Any CPU
{EE443C17-B31D-4AD0-9141-920876E7DF79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EE443C17-B31D-4AD0-9141-920876E7DF79}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EE443C17-B31D-4AD0-9141-920876E7DF79}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EE443C17-B31D-4AD0-9141-920876E7DF79}.Release|Any CPU.Build.0 = Release|Any CPU
{CB4664CE-F451-401D-862F-4A74A80B8161}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB4664CE-F451-401D-862F-4A74A80B8161}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB4664CE-F451-401D-862F-4A74A80B8161}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB4664CE-F451-401D-862F-4A74A80B8161}.Release|Any CPU.Build.0 = Release|Any CPU
{E2BCA278-8741-4116-B0E0-B20849D66739}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E2BCA278-8741-4116-B0E0-B20849D66739}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E2BCA278-8741-4116-B0E0-B20849D66739}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E2BCA278-8741-4116-B0E0-B20849D66739}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

@ -1,6 +1,8 @@
<?xml version = "1.0" encoding = "UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:model="clr-namespace:Biblioteque_de_Class;assembly=Biblioteque_de_Class"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:notus"
x:Class="notus.App">
<Application.Resources>
@ -11,4 +13,5 @@
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

@ -1,11 +1,59 @@
namespace notus;

using Biblioteque_de_Class;
using Notus_Persistance;
namespace notus;
public partial class App : Application
{
public App()
{
public PersistenceManager Mgr { get; private set; } = new PersistenceManager(new Stub());
public Database db = new Database();
public App()
{
InitializeComponent();
MainPage = new AppShell();
}
db = Mgr.LoadDatabaseData();
BindingContext = db;
MainPage = new AppShell();
}
protected override Window CreateWindow(IActivationState activationState)
{
Window window = base.CreateWindow(activationState);
// Set minimum height and width
window.MinimumHeight = 670;
window.MinimumWidth = 1200;
return window;
}
private User selecUser;
public User SelectedUser
{
get
{
return selecUser;
}
set
{
selecUser = value;
OnPropertyChanged(nameof(SelectedUser));
}
}
private Note selecNote;
public Note SelectedNote
{
get
{
return selecNote;
}
set
{
selecNote = value;
OnPropertyChanged(nameof(SelectedNote));
}
}
}

@ -3,11 +3,14 @@
x:Class="notus.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:model="clr-namespace:Biblioteque_de_Class;assembly=Biblioteque_de_Class"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:notus"
Shell.FlyoutBehavior="Locked"
Shell.FlyoutWidth="30"
Shell.NavBarIsVisible="False">
Shell.NavBarIsVisible="False"
Shell.BackgroundColor="Grey">
<ShellContent
Title="main_page"
ContentTemplate="{DataTemplate local:MainPage}"
@ -22,6 +25,15 @@
Title="recherche_page"
ContentTemplate="{DataTemplate local:RecherPage}"
Route="RecherPage"/>
<ShellContent
Title="Inscription_Page"
ContentTemplate="{DataTemplate local:InscrPage}"
Route="InscrPage"/>
<ShellContent
Title="ProfilPage"
ContentTemplate="{DataTemplate local:ProfilPage}"
Route="ProfilPage"/>
</Shell>

@ -1,7 +1,11 @@
namespace notus;
using Biblioteque_de_Class;
using Notus_Persistance;
namespace notus;
public partial class AppShell : Shell{
public AppShell(){
public AppShell(){
InitializeComponent();
}
}
}

@ -5,19 +5,24 @@
x:Class="notus.ConnecPage"
Title="ConnecPage"
BackgroundColor="#1C1C1C">
<Shell.BackButtonBehavior>
<BackButtonBehavior
IsVisible="False"
IsEnabled="False"/>
</Shell.BackButtonBehavior>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="80"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1.8*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1.8*"/>
<RowDefinition Height="1.5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="4*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="4*"/>
@ -26,6 +31,21 @@
<ColumnDefinition Width="4*"/>
</Grid.ColumnDefinitions>
<ImageButton
Source="return.png"
Aspect="AspectFit"
Grid.Column="0"
Grid.Row="0"
HorizontalOptions="Start"
VerticalOptions="Start"
WidthRequest="50"
HeightRequest="50"
BackgroundColor="#4A4A4A"
Margin="10,10,0,0"
CornerRadius="50"
Clicked="Back_Clicked"
/>
<Label
Grid.Column="1"
Grid.ColumnSpan="3"
@ -35,35 +55,54 @@
Text="Connection"
TextColor="#74fabd"
FontSize="80"
FontFamily="strong"/>
FontFamily="strong"
/>
<Entry
Grid.Column="1"
Grid.ColumnSpan="3"
Grid.Row="3"
<Entry x:Name="username"
Grid.Column="1"
Grid.ColumnSpan="3"
Grid.Row="3"
FontSize="22"
Placeholder="entrer votre e-mail"
Placeholder="entrer votre Username"
PlaceholderColor="#74fabd"
BackgroundColor="#4A4A4A"/>
TextColor="#74fabd"
BackgroundColor="#4A4A4A"
Text="{Binding Username}"
/>
<Entry
Grid.Column="1"
Grid.ColumnSpan="3"
Grid.Row="5"
<Entry x:Name="password"
Grid.Column="1"
Grid.ColumnSpan="3"
Grid.Row="5"
FontSize="22"
Placeholder="entrer votre mot de passe"
PlaceholderColor="#74fabd"
BackgroundColor="#4A4A4A"/>
TextColor="#74fabd"
IsPassword="true"
BackgroundColor="#4A4A4A"
Text="{Binding Password}"
/>
<Button
Grid.Column="2"
Grid.ColumnSpan="1"
Grid.Row="7"
BackgroundColor="#74fabd"/>
</Grid>
WidthRequest="80"
Grid.Column="2"
Grid.ColumnSpan="1"
Grid.Row="7"
Text="Valider"
TextColor="Black"
BackgroundColor="#74fabd"
Clicked="Connec_Clicked"
/>
<Label
x:Name="ResultSearch"
Text="Incorrect email or password."
IsVisible="false"
Grid.Column="2"
Grid.Row="7"
TextColor="Red"
/>
</Grid>
</ContentPage>

@ -1,9 +1,46 @@
namespace notus;
public partial class ConnecPage : ContentPage
{
public ConnecPage()
{
InitializeComponent();
}
using Biblioteque_de_Class;
using Windows.UI.Core;
namespace notus;
public partial class ConnecPage : ContentPage
{
User selectUser = (Application.Current as App).SelectedUser;
Database db = (Application.Current as App).db;
public string Username { get; set; }
public string Password { get; set; }
public ConnecPage()
{
InitializeComponent();
BindingContext = this;
}
private void Connec_Clicked(object sender, EventArgs e)
{
try
{
selectUser = db.GetUser(Username);
}
catch (NotFoundException)
{
DisplayAlert("Erreur", "Cet utilisateur n'existe pas" , "OK");
return;
}
if (Database.ComparePassword(selectUser, HashCodeModel.GetSHA256Hash(Password).ToString()))
{
selectUser.IsConnected = true;
(Application.Current as App).SelectedUser = selectUser;
Navigation.PushAsync(new RecherPage());
}
else
{
DisplayAlert("Erreur", "Le mot de passe est incorrect", "OK");
return;
}
}
private void Back_Clicked(object sender, EventArgs e)
{
Navigation.PopAsync();
}
}

@ -0,0 +1,133 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dodnet/2022/maui/toolkit"
x:Class="notus.InscrPage"
Title="InscrPage"
BackgroundColor="#1C1C1C">
<Shell.BackButtonBehavior>
<BackButtonBehavior
IsVisible="False"
IsEnabled="False"/>
</Shell.BackButtonBehavior>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="80"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="1.8*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1.8*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1.8*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1.6*"/>
<RowDefinition Height="4*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="0.9*"/>
<ColumnDefinition Width="0.2*"/>
<ColumnDefinition Width="4*"/>
</Grid.ColumnDefinitions>
<ImageButton
Source="return.png"
Aspect="AspectFit"
Grid.Column="0"
Grid.Row="0"
HorizontalOptions="Start"
VerticalOptions="Start"
WidthRequest="50"
HeightRequest="50"
BackgroundColor="#4A4A4A"
Margin="10,10,0,0"
CornerRadius="50"
Clicked="Back_Clicked"
/>
<Label
Grid.Column="1"
Grid.ColumnSpan="3"
Grid.Row="1"
HorizontalOptions="Center"
VerticalOptions="Center"
Text="Inscription"
TextColor="#74fabd"
FontSize="80"
FontFamily="strong"
/>
<Entry
Placeholder="Pseudo"
FontSize="22"
Grid.Column="1"
Grid.ColumnSpan="3"
Grid.Row="3"
TextColor="#74fabd"
BackgroundColor="#4A4A4A"
PlaceholderColor="#74fabd"
Text="{Binding Username}"
/>
<Entry
Placeholder="Mot de passe"
FontSize="22"
Grid.Column="1"
Grid.ColumnSpan="3"
Grid.Row="5"
IsPassword="true"
TextColor="#74fabd"
BackgroundColor="#4A4A4A"
PlaceholderColor="#74fabd"
Text="{Binding Password}"
/>
<Entry
Placeholder ="Verif mot de passe"
FontSize="22"
Grid.Column="1"
Grid.ColumnSpan="3"
Grid.Row="7"
IsPassword="true"
TextColor="#74fabd"
BackgroundColor="#4A4A4A"
PlaceholderColor="#74fabd"
Text="{Binding RePassword}"
/>
<Button
WidthRequest="80"
Grid.Column="2"
Grid.ColumnSpan="1"
Grid.Row="9"
Text="Valider"
TextColor="Black"
BackgroundColor="#74fabd"
Clicked="Inscription_Clicked"
/>
<Label
x:Name="userUser"
Text="User Already exist."
IsVisible="false"
Grid.Column="1"
Grid.Row="4"
TextColor="Red"
/>
<Label
x:Name="shortPassword"
Text="Password to short."
IsVisible="false"
Grid.Column="1"
Grid.Row="6"
TextColor="Red"
/>
</Grid>
</ContentPage>

@ -0,0 +1,47 @@
using Biblioteque_de_Class;
namespace notus;
public partial class InscrPage : ContentPage
{
Database datab = (Application.Current as App).db;
public string Username { get; set; }
public string Password { get; set; }
public string RePassword { get; set; }
public InscrPage()
{
InitializeComponent();
BindingContext = this;
}
private async void Inscription_Clicked(object sender, EventArgs e)
{
if (Password.Length < 8) { shortPassword.IsVisible = true; return; }
if (Password != RePassword)
{
await DisplayAlert("Erreur", "Les mots de passe ne sont pas identiques", "OK");
return;
}
else if (Username == null || Password == null)
{
await DisplayAlert("Erreur", "Veuillez remplir tous les champs", "OK");
return;
}
try
{
datab.AddUser(new User(Username,"",Password));
}
catch (AlreadyUsedException)
{
userUser.IsVisible = true;
return;
}
(Application.Current as App).SelectedUser = datab.GetUser(Username);
await Navigation.PushAsync(new RecherPage());
}
private void Back_Clicked(object sender, EventArgs e)
{
Navigation.PopAsync();
}
}

@ -14,6 +14,7 @@
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="4*"/>
@ -29,17 +30,20 @@
TextColor="#74fabd"
FontSize="120"
FontAttributes="Bold"
FontFamily="strong"/>
FontFamily="strong"
/>
<Button
CornerRadius="50"
Text="Connection"
Text="Connexion"
TextColor="#74fabd"
FontSize="30"
Grid.Row="2"
Grid.Column="1"
HeightRequest="75"
BackgroundColor="#4A4A4A"/>
BackgroundColor="#4A4A4A"
Clicked="Connec_Clicked"
/>
<Button
CornerRadius="50"
@ -49,7 +53,9 @@
Grid.Row="3"
Grid.Column="1"
HeightRequest="75"
BackgroundColor="#4A4A4A"/>
BackgroundColor="#4A4A4A"
Clicked="Inscr_Clicked"
/>
</Grid>

@ -1,8 +1,19 @@
namespace notus;
public partial class MainPage : ContentPage{
public MainPage(){
InitializeComponent();
}
}
namespace notus;
public partial class MainPage : ContentPage{
public MainPage(){
InitializeComponent();
}
private async void Connec_Clicked(object sender, EventArgs e)
{
await Navigation.PushAsync(new ConnecPage());
}
private async void Inscr_Clicked(object sender, EventArgs e)
{
await Navigation.PushAsync(new InscrPage());
}
}

@ -0,0 +1,179 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dodnet/2022/maui/toolkit"
x:Class="notus.ProfilPage"
Title="ProfilPage"
BackgroundColor="#1C1C1C">
<Shell.BackButtonBehavior>
<BackButtonBehavior
IsVisible="False"
IsEnabled="False"/>
</Shell.BackButtonBehavior>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="6*"/>
</Grid.ColumnDefinitions>
<ImageButton
Source="return.png"
Aspect="AspectFit"
Grid.Column="0"
Grid.Row="0"
HorizontalOptions="Start"
VerticalOptions="Start"
WidthRequest="50"
HeightRequest="50"
BackgroundColor="#4A4A4A"
Margin="10,10,0,0"
CornerRadius="50"
Clicked="Back_Clicked"
/>
<Grid Grid.Column="0">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="250"/>
<RowDefinition Height="20"/>
<RowDefinition Height="20"/>
<RowDefinition Height="90"/>
<RowDefinition Height="100"/>
<RowDefinition Height="90"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Image Source="{Binding ProfilPicture}"
HorizontalOptions="Center"
VerticalOptions="Center"
Grid.Row="1"
BackgroundColor="#4A4A4A"
WidthRequest="250"
HeightRequest="250"
Margin="0,0,0,30"
/>
<Label Text="{Binding Username}" VerticalOptions="Center"
Grid.Row="2"
BackgroundColor="#4A4A4A"
WidthRequest="260"
HeightRequest="60"
TextColor="#74fabd"/>
<Button
VerticalOptions="End"
Text="Modifier Profil"
TextColor="#74fabd"
WidthRequest="300"
BackgroundColor="#4A4A4A"
Grid.Row="4"
HeightRequest="80"
FontSize="30"
Margin="0,20,0,0"
Clicked="Modify_Profil"
/>
<Button
VerticalOptions="Center"
Text="Modifier Theme"
TextColor="#74fabd"
WidthRequest="300"
BackgroundColor="#4A4A4A"
Grid.Row="5"
HeightRequest="80"
FontSize="30"
Margin="0,20,0,0"
Clicked="Modify_Theme"
/>
<Button
VerticalOptions="Start"
Text="se déconnecter"
FontSize="30"
TextColor="#74fabd"
WidthRequest="300"
BackgroundColor="#4A4A4A"
Grid.Row="6"
HeightRequest="80"
Margin="0,20,0,0"
Clicked="Disconnect_Clicked"
/>
</Grid>
<Grid x:Name="TagsZone" Grid.Column="1" Margin="40" BackgroundColor="#4A4A4A" IsVisible="True">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="250"/>
<RowDefinition Height="40"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ScrollView Grid.Row="1" VerticalScrollBarVisibility="Always" HorizontalScrollBarVisibility="Never">
<StackLayout x:Name="TagListContainer" Padding="10" Spacing="5">
<ListView x:Name="TagListView" SeparatorVisibility="None" BackgroundColor="Transparent">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<BoxView Grid.Column="0" BackgroundColor="{Binding Color}" WidthRequest="40" />
<Label Grid.Column="1" Text="{Binding Name}" VerticalTextAlignment="Center" />
<Button Grid.Column="2" Text="Modify" Clicked="Modify_Clicked"/>
<Button Grid.Column="3" Text="Delete" Clicked="Delete_Clicked" VerticalOptions="End"/>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ScrollView>
<Grid Grid.Row="2" HorizontalOptions="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Text="Add" Command="{Binding AddTagCommand}" HorizontalOptions="Center" />
</Grid>
</Grid>
<Grid x:Name="ProfilZone" Grid.Column="1" Margin="40" BackgroundColor="#4A4A4A" IsVisible="false">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="250"/>
<RowDefinition Height="20"/>
<RowDefinition Height="20"/>
<RowDefinition Height="90"/>
<RowDefinition Height="100"/>
<RowDefinition Height="90"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
</Grid>
<Grid x:Name="ThemeZone" Grid.Column="1" Margin="40" BackgroundColor="#4A4A4A" IsVisible="false">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="250"/>
<RowDefinition Height="20"/>
<RowDefinition Height="20"/>
<RowDefinition Height="90"/>
<RowDefinition Height="100"/>
<RowDefinition Height="90"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
</Grid>
</Grid>
</ContentPage>

@ -0,0 +1,101 @@
using Microsoft.Maui.Controls;
using Biblioteque_de_Class;
using Notus_Persistance;
using NHibernate.Mapping;
using System.Collections.ObjectModel;
namespace notus;
public partial class ProfilPage : ContentPage
{
public User SelectedUser = (Application.Current as App).SelectedUser;
private string username;
public string Username
{
get => username;
set
{
username = value;
OnPropertyChanged(nameof(Username));
(Application.Current as App).SelectedUser.Username = username;
}
}
private string password;
public string Password
{
get => password;
set
{
password = value;
OnPropertyChanged(nameof(Password));
(Application.Current as App).SelectedUser.Password = password;
}
}
private string profilPicture;
public string ProfilPicture
{
get => profilPicture;
set
{
profilPicture = value;
OnPropertyChanged(nameof(ProfilPicture));
(Application.Current as App).SelectedUser.Picture = profilPicture;
}
}
public ProfilPage()
{
InitializeComponent();
Username = SelectedUser.Username;
Password = SelectedUser.Password;
ProfilPicture = SelectedUser.Picture;
BindingContext = this;
}
private void Back_Clicked(object sender, EventArgs e)
{
Navigation.PopAsync();
}
private void Disconnect_Clicked(object sender, EventArgs e)
{
(Application.Current as App).SelectedUser.IsConnected = false;
Navigation.PopAsync();
Navigation.PopAsync();
Navigation.PopAsync();
(Application.Current as App).SelectedUser = null;
}
private void AddTag_Clicked(object sender, EventArgs e)
{
// Handle add tag action
// Show color picker and name input dialog
// Create a new Tag object and add it to the Tags collection
}
private void Modify_Clicked(object sender, EventArgs e)
{
// Handle modify action for the tag
}
private void Delete_Clicked(object sender, EventArgs e)
{
// Handle delete action for the tag
}
private void Modify_Profil(object sender, EventArgs e)
{
if (ProfilZone.IsVisible == true) { ProfilZone.IsVisible = false; return; }
ThemeZone.IsVisible = false;
ProfilZone.IsVisible = true;
}
private void Modify_Theme(object sender, EventArgs e)
{
if (ThemeZone.IsVisible == true) { ThemeZone.IsVisible = false; return;}
ProfilZone.IsVisible = false;
ThemeZone.IsVisible = true;
}
}

@ -1,17 +1,152 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dodnet/2022/maui/toolkit"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2021/maui/toolkit"
xmlns:muxc = "using:Microsoft.UI.Xaml.Controls"
x:Class="notus.RecherPage"
Title="RecherPage"
Title="Main Page"
BackgroundColor="#1C1C1C">
<Shell.BackButtonBehavior>
<BackButtonBehavior
IsVisible="False"
IsEnabled="False"/>
</Shell.BackButtonBehavior>
<ContentPage.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="MasterColumn" Width="320" />
<ColumnDefinition x:Name="DetailColumn" Width="*" />
</Grid.ColumnDefinitions>
<Border Background="#6E6E6E" Grid.Column="0" Grid.RowSpan="3" />
<Grid Margin="0,11,0,13" Grid.Column="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<SearchBar Placeholder="Search Note" Text="{Binding SearchNoteText}" HorizontalOptions="Start" Margin="10" VerticalOptions="Center" WidthRequest="300" HeightRequest="50" FontSize="25" TextColor="#74fabd" BackgroundColor="#4A4A4A" PlaceholderColor="#74fabd" TextChanged="OnSearchNoteTextChanged" />
<CheckBox x:Name="FavoritesCheckBox" CheckedChanged="FavoritesFilter_CheckedChanged" WidthRequest="50" HeightRequest="50" Margin="40,0,0,0" HorizontalOptions="Start" VerticalOptions="Center" Grid.Row="1" />
<ImageButton Source="tagsfilter.png" BackgroundColor="#4A4A4A" Clicked="TagsFilter_Clicked" WidthRequest="50" HeightRequest="50" CornerRadius="50" Margin="20" HorizontalOptions="Center" VerticalOptions="Center" Grid.Row="1"/>
<ImageButton Source="Datefilter.png" BackgroundColor="#4A4A4A" Clicked="DatesFilter_Clicked" WidthRequest="50" HeightRequest="50" CornerRadius="50" Margin="20" HorizontalOptions="End" VerticalOptions="Center" Grid.Row="1"/>
<ScrollView x:Name="TheScrollView" Grid.Row="2" Grid.Column="0" VerticalOptions="Start" Margin="5,5,5,5">
<ContentView>
<ListView ItemsSource="{Binding NoteList, Mode=TwoWay}" ItemSelected="NoteListView_ItemSelected" VerticalOptions="StartAndExpand">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Orientation="Horizontal" HeightRequest="40" Padding="3" Margin="3" BackgroundColor="#4A4A4A" MinimumWidthRequest="400" MaximumWidthRequest="400">
<CheckBox IsChecked="{Binding IsFavorite, Mode=TwoWay}" CheckedChanged="FavoriteCheckBox_CheckedChanged" HeightRequest="20" HorizontalOptions="End" VerticalOptions="Center"/>
<StackLayout Orientation="Horizontal">
<Image Source="{Binding LogoPath}" HorizontalOptions="Start" VerticalOptions="Center"/>
<Label Text="{Binding Name}" TextColor="#74fabd" HorizontalOptions="Center" VerticalOptions="Center"/>
</StackLayout>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentView>
</ScrollView>
</Grid>
<ImageButton Source="create.png" BackgroundColor="#4A4A4A" Clicked="CreateNote_Clicked" WidthRequest="50" HeightRequest="50" CornerRadius="50" Margin="20" HorizontalOptions="Start" VerticalOptions="End" />
<Grid Grid.Row="0" Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="350" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ImageButton Source="{Binding LogoPath}" Aspect="AspectFit" Grid.Column="0" Grid.Row="0" Margin="20" HorizontalOptions="Start" VerticalOptions="Start" WidthRequest="50" HeightRequest="50" BackgroundColor="#4A4A4A" CornerRadius="50" />
<Entry Text="{Binding Name}" Grid.Column="0" Grid.Row="0" TextColor="#74fabd" Margin="20" FontSize="21" BackgroundColor="#4A4A4A" WidthRequest="250" HeightRequest="50" HorizontalOptions="End" VerticalOptions="Start" />
<ImageButton Source="supp.png" Clicked="Delete_Note" Aspect="AspectFill" Grid.Column="2" Grid.Row="0" Margin="20" HorizontalOptions="Start" VerticalOptions="Start" WidthRequest="50" HeightRequest="50" BackgroundColor="#4A4A4A" CornerRadius="50" />
<ImageButton Source="AddUser.png" Clicked="AddUser_Clicked" Grid.Column="2" Grid.Row="0" BackgroundColor="#4A4A4A" Margin="120,20,20,20" HorizontalOptions="Start" VerticalOptions="Start" WidthRequest="50" HeightRequest="50" CornerRadius="50"/>
<ImageButton Source="{Binding ProfilPicture}" Clicked="Profil_Clicked" Aspect="AspectFit" Grid.Column="2" Grid.Row="0" HorizontalOptions="End" VerticalOptions="Start" WidthRequest="200" HeightRequest="120" BackgroundColor="#6E6E6E"/>
<Editor
x:Name="textZone"
Placeholder="Text"
FontSize="18"
Text="{Binding Text, Mode=TwoWay}"
TextColor="#74fabd" BackgroundColor="#4A4A4A"
PlaceholderColor="#74fabd"
Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="2"
VerticalTextAlignment="Start"
Margin="20"
TextChanged="OnEditorTextChanged"
Completed="OnEditorCompleted"/>
<Grid
x:Name="AddUser_Zone"
Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="2"
BackgroundColor="#6E6E6E"
IsVisible="false"
Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<SearchBar Placeholder="Search User" Text="{Binding SearchNoteText}" HorizontalOptions="Start" Margin="20" VerticalOptions="Center" WidthRequest="400" HeightRequest="50" FontSize="25" TextColor="#74fabd" BackgroundColor="#4A4A4A" PlaceholderColor="#74fabd" TextChanged="OnSearchNoteTextChanged" />
<ScrollView x:Name="UserListScrollView" Grid.Row="0" Grid.RowSpan="4" Grid.Column="0" Grid.ColumnSpan="3" VerticalOptions="Start" HorizontalOptions="Start" Margin="20,90,0,0" BackgroundColor="#4A4A4A" MinimumWidthRequest="600" MaximumWidthRequest="600">
<ContentView>
<ListView ItemsSource="{Binding UserList, Mode=TwoWay}" ItemSelected="NoteListView_ItemSelected" VerticalOptions="StartAndExpand">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Orientation="Horizontal" HeightRequest="40" Padding="3" Margin="3" BackgroundColor="#4A4A4A" MinimumWidthRequest="300" MaximumWidthRequest="300">
<CheckBox IsChecked="{Binding AJouter, Mode=TwoWay}" CheckedChanged="AddUserCheckBox_CheckedChanged" HeightRequest="20" HorizontalOptions="End" VerticalOptions="Center"/>
<Image Source="{Binding ProfilPictureUser}" HorizontalOptions="Start" VerticalOptions="Center"/>
<Label Text="{Binding UserNameUser}" TextColor="#74fabd" HorizontalOptions="Center" VerticalOptions="Center"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentView>
</ScrollView>
<Button
x:Name="Valid"
Text="Valid"
Grid.Row="3"
Grid.Column="3"
TextColor="#74fabd"
WidthRequest="70"
HeightRequest="50"
HorizontalOptions="End"
VerticalOptions="End"
Margin="0,0,20,20"
Clicked="Valid_Clicked"
BackgroundColor="#4A4A4A"/>
</Grid>
</Grid>
</Grid>
</ContentPage.Content>
</ContentPage>

@ -1,9 +1,361 @@
namespace notus;
public partial class RecherPage : ContentPage
{
public RecherPage()
{
InitializeComponent();
}
using Microsoft.Maui.Controls;
using Biblioteque_de_Class;
using Notus_Persistance;
using System.Xml.Linq;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Microsoft.Maui;
using System.Globalization;
using System.Drawing;
namespace notus
{
public partial class RecherPage : ContentPage, INotifyPropertyChanged
{
private ObservableCollection<Note> noteList;
public ObservableCollection<Note> NoteList
{
get { return noteList; }
set
{
noteList = value;
OnPropertyChanged(nameof(NoteList));
}
}
private ObservableCollection<Note> allNotes; // Store all notes initially
private Database db = (Application.Current as App).db;
public User SelectedUser = (Application.Current as App).SelectedUser;
public Note SelectedNote
{
get => (Application.Current as App).SelectedNote;
set
{
if ((Application.Current as App).SelectedNote != value)
{
(Application.Current as App).SelectedNote = value;
OnPropertyChanged(nameof(SelectedNote));
NoteList = new ObservableCollection<Note>(SelectedUser.NoteList);
allNotes = new ObservableCollection<Note>(NoteList);
Name = SelectedNote.Name;
Text = SelectedNote.Text;
LogoPath = SelectedNote.LogoPath;
}
}
}
private string name;
public string Name
{
get { return name; }
set
{
if (name != value)
{
name = value;
OnPropertyChanged(nameof(Name));
if (SelectedNote != null)
{
try
{
SelectedNote.ChangeName(SelectedUser, value);
}
catch (NotAllowedException)
{
Name = SelectedNote.Name;
}
}
}
}
}
private string text;
public string Text
{
get { return text; }
set
{
if (text != value)
{
text = value;
OnPropertyChanged(nameof(Text));
if (SelectedNote != null)
{
try
{
SelectedNote.VerifyPrivilege(SelectedUser);
}
catch (NotAllowedException)
{
Text = SelectedNote.Text;
return;
}
SelectedNote.Text = value;
}
}
}
}
private string logoPath;
public string LogoPath
{
get { return logoPath; }
set
{
if (logoPath != value)
{
logoPath = value;
OnPropertyChanged(nameof(LogoPath));
if (SelectedNote != null)
{
try
{
SelectedNote.ChangeLogo(SelectedUser, value);
}
catch (NotAllowedException)
{
LogoPath = SelectedNote.LogoPath;
}
}
}
}
}
public string SearchNoteText { get; set; }
public string ProfilPicture { get; set; }
public RecherPage()
{
InitializeComponent();
allNotes = new ObservableCollection<Note>(SelectedUser.NoteList);
NoteList = allNotes;
SelectedNote = SelectedUser.NoteList
.OrderByDescending(note => note.ModificationDate)
.FirstOrDefault();
(Application.Current as App).SelectedNote = SelectedNote;
Name = SelectedNote.Name;
Text = SelectedNote.Text;
LogoPath = SelectedNote.LogoPath;
ProfilPicture = SelectedUser.Picture;
BindingContext = this;
}
private void CreateNote_Clicked(object sender, EventArgs e)
{
SelectedUser.CreateNote("", "");
SelectedNote = SelectedUser.NoteList[SelectedUser.NoteList.Count - 1];
}
private async void Profil_Clicked(object sender, EventArgs e)
{
(Application.Current as App).SelectedUser = SelectedUser;
await Navigation.PushAsync(new ProfilPage());
}
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
void OnEditorTextChanged(object sender, TextChangedEventArgs e)
{
string newText = e.NewTextValue;
if (SelectedNote != null)
{
SelectedNote.Text = newText;
(Application.Current as App).SelectedNote = SelectedNote;
}
Text = SelectedNote.Text;
}
void OnEditorCompleted(object sender, EventArgs e)
{
if (SelectedNote != null)
{
SelectedNote.Text = ((Editor)sender).Text;
(Application.Current as App).SelectedNote = SelectedNote;
}
}
private void NoteListView_ItemSelected(object sender, SelectedItemChangedEventArgs e)
{
if (e.SelectedItem is Note selectedNote)
{
SelectedNote = selectedNote;
(Application.Current as App).SelectedNote = SelectedNote;
Name = SelectedNote.Name;
Text = SelectedNote.Text;
LogoPath = SelectedNote.LogoPath;
}
}
private void AddUser_Clicked(object sender, EventArgs e)
{
if (AddUser_Zone.IsVisible)
AddUser_Zone.IsVisible = false;
else
AddUser_Zone.IsVisible = true;
}
private void Valid_Clicked(object sender, EventArgs e)
{
AddUser_Zone.IsVisible = false;
}
private void AddUserCheckBox_CheckedChanged(object sender, CheckedChangedEventArgs e)
{
}
public void Delete_Note(object sender, EventArgs e)
{
if (SelectedNote != null)
{
SelectedUser.NoteList.Remove(SelectedNote);
if (SelectedUser.NoteList.Count == 0)
{
SelectedUser.CreateNote("","");
}
SelectedNote = SelectedUser.NoteList.FirstOrDefault(); // Select the first note in the list (or null if empty)
}
}
private int windowHeight;
public int WindowHeight
{
get { return windowHeight; }
set
{
if (windowHeight != value)
{
windowHeight = value - 300;
OnPropertyChanged(nameof(WindowHeight));
UpdateScrollViewHeight();
}
}
}
protected override void OnSizeAllocated(double width, double height)
{
base.OnSizeAllocated(width, height);
if (WindowHeight != (int)height)
{
WindowHeight = (int)height;
UpdateScrollViewHeight();
}
}
private void UpdateScrollViewHeight()
{
double availableHeight = WindowHeight;
TheScrollView.MaximumHeightRequest = availableHeight;
UserListScrollView.MinimumHeightRequest = availableHeight;
UserListScrollView.MaximumHeightRequest = availableHeight;
}
private bool isFavoritesFilterChecked = false;
private List<Tags> selectedTags = new List<Tags>();
private DateOnly startDate;
private DateOnly endDate;
private bool isfavorite;
public bool IsFavorite
{
get => isfavorite;
set
{
if (IsFavorite != value)
{
IsFavorite = value;
OnPropertyChanged(nameof(IsFavorite));
}
}
}
void OnSearchNoteTextChanged(object sender, TextChangedEventArgs e)
{
string searchText = e.NewTextValue;
if (string.IsNullOrEmpty(searchText))
{
ApplyFilters();
}
else
{
var filteredNotes = NoteList.Where(note => note.Name.Contains(searchText));
NoteList = new ObservableCollection<Note>(filteredNotes);
}
}
private void FavoritesFilter_CheckedChanged(object sender, CheckedChangedEventArgs e)
{
isFavoritesFilterChecked = e.Value;
ApplyFilters();
}
private void TagsFilter_Clicked(object sender, EventArgs e)
{
ApplyFilters();
}
private void DatesFilter_Clicked(object sender, EventArgs e)
{
ApplyFilters();
}
private void ApplyFilters()
{
var filteredNotes = allNotes;
if (isFavoritesFilterChecked)
{
var FavfilteredNotes = allNotes.Where(note => SelectedUser.FavList.Contains(note));
NoteList = new ObservableCollection<Note>(FavfilteredNotes);
filteredNotes = NoteList;
}
if (selectedTags.Count > 0)
{
filteredNotes = (ObservableCollection<Note>)filteredNotes.Where(note => SelectedUser.NoteTagged[note].Any(tag => selectedTags.Contains(tag)));
}
if (startDate != default && endDate != default)
{
filteredNotes = (ObservableCollection<Note>)filteredNotes.Where(note => note.CreationDate >= startDate && note.CreationDate <= endDate || note.ModificationDate >= startDate && note.ModificationDate <= endDate);
}
foreach (var note in filteredNotes)
{
note.IsFavorite = SelectedUser.FavList.Contains(note);
IsFavorite = note.IsFavorite;
}
NoteList = new ObservableCollection<Note>(filteredNotes);
}
private void FavoriteCheckBox_CheckedChanged(object sender, CheckedChangedEventArgs e)
{
CheckBox checkBox = (CheckBox)sender;
Note note = checkBox.BindingContext as Note;
if (note != null)
{
if (e.Value)
{
if(note.IsFavorite == false)
SelectedUser.AddFavorite(note);
(Application.Current as App).SelectedUser = SelectedUser;
allNotes = new ObservableCollection<Note>(SelectedUser.NoteList);
}
else
{
if (note.IsFavorite == true)
SelectedUser.RemoveFavorite(note);
(Application.Current as App).SelectedUser = SelectedUser;
allNotes = new ObservableCollection<Note>(SelectedUser.NoteList);
}
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<!--<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>-->
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
@ -53,10 +53,21 @@
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Biblioteque_de_Class\Biblioteque_de_Class.csproj" />
<ProjectReference Include="..\Notus_Persistence\Notus_Persistance.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="ConnecPage.xaml.cs">
<DependentUpon>ConnecPage.xaml</DependentUpon>
</Compile>
<Compile Update="InscrPage.xaml.cs">
<DependentUpon>InscrPage.xaml</DependentUpon>
</Compile>
<Compile Update="ProfilPage.xaml.cs">
<DependentUpon>ProfilPage.xaml</DependentUpon>
</Compile>
<Compile Update="RecherPage.xaml.cs">
<DependentUpon>RecherPage.xaml</DependentUpon>
</Compile>
@ -66,6 +77,12 @@
<MauiXaml Update="ConnecPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="InscrPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="ProfilPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="RecherPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>

@ -3,9 +3,21 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31611.283
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Biblioteque_de_Class", "Biblioteque_de_Class\Biblioteque_de_Class.csproj", "{92DD50C5-EEAD-44ED-AEFF-E21935725477}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Notus_Vue", "notus_vue\Notus_Vue.csproj", "{561264A1-4611-40FB-A662-3EF65550CA71}"
ProjectSection(ProjectDependencies) = postProject
{184478A9-E14F-42E0-B963-B3A4474C9C1C} = {184478A9-E14F-42E0-B963-B3A4474C9C1C}
{92DD50C5-EEAD-44ED-AEFF-E21935725477} = {92DD50C5-EEAD-44ED-AEFF-E21935725477}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Notus_Console", "Notus_Console\Notus_Console.csproj", "{0A5E5F33-6B39-42BF-A46D-0752EDB666FB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Biblioteque_de_Class", "Biblioteque_de_Class\Biblioteque_de_Class.csproj", "{92DD50C5-EEAD-44ED-AEFF-E21935725477}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Notus_Console", "Notus_Console\Notus_Console.csproj", "{0A5E5F33-6B39-42BF-A46D-0752EDB666FB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Notus_Persistance", "Notus_Persistence\Notus_Persistance.csproj", "{184478A9-E14F-42E0-B963-B3A4474C9C1C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests_Model", "Tests\UnitTests_Model\UnitTests_Model.csproj", "{CB4664CE-F451-401D-862F-4A74A80B8161}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests_Persistance", "Tests\UnitTests_Persistance\UnitTests_Persistance.csproj", "{E2BCA278-8741-4116-B0E0-B20849D66739}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -21,6 +33,18 @@ Global
{0A5E5F33-6B39-42BF-A46D-0752EDB666FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0A5E5F33-6B39-42BF-A46D-0752EDB666FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0A5E5F33-6B39-42BF-A46D-0752EDB666FB}.Release|Any CPU.Build.0 = Release|Any CPU
{184478A9-E14F-42E0-B963-B3A4474C9C1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{184478A9-E14F-42E0-B963-B3A4474C9C1C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{184478A9-E14F-42E0-B963-B3A4474C9C1C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{184478A9-E14F-42E0-B963-B3A4474C9C1C}.Release|Any CPU.Build.0 = Release|Any CPU
{CB4664CE-F451-401D-862F-4A74A80B8161}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB4664CE-F451-401D-862F-4A74A80B8161}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB4664CE-F451-401D-862F-4A74A80B8161}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB4664CE-F451-401D-862F-4A74A80B8161}.Release|Any CPU.Build.0 = Release|Any CPU
{E2BCA278-8741-4116-B0E0-B20849D66739}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E2BCA278-8741-4116-B0E0-B20849D66739}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E2BCA278-8741-4116-B0E0-B20849D66739}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E2BCA278-8741-4116-B0E0-B20849D66739}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -28,4 +52,4 @@ Global
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572}
EndGlobalSection
EndGlobal
EndGlobal

Loading…
Cancel
Save