diff --git a/MCTG/MCTGLib/User.cs b/MCTG/MCTGLib/User.cs index dce3d83..f4a2f65 100644 --- a/MCTG/MCTGLib/User.cs +++ b/MCTG/MCTGLib/User.cs @@ -33,18 +33,17 @@ namespace MCTGLib get => picture; set { - picture = value; - if (picture == null) + if (string.IsNullOrWhiteSpace(value)) { - picture = "PhotoParDefaut"; + throw new ArgumentNullException("Erreur pour la photo d'utilisateur!"); } - } + } /// - /// Property to get Name of users, without setter because we don't want users - /// to change their Name. + /// Property to get Name of users and a setter /// + /// Setter have Exception which is trigger when Name is null public string Name { get { return name; } @@ -52,15 +51,26 @@ namespace MCTGLib { if (string.IsNullOrWhiteSpace(value)) { - throw new ArgumentNullException(); + throw new ArgumentNullException("Il y a une erreur de Nom d'utilisateur!"); } name = value; } } + /// + /// Property to get Surname of users and a setter + /// + /// Setter have Exception which is trigger when Surname is null public string Surname { get { return surname; } - private set { surname = value; } + private set + { + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentNullException("Il y a une erreur de Prénom d'utilisateur"); + } + surname = value; + } } public string Mail {