Modification of the property Mail. Now, we want this property to never be empty or null because it will serve for login
continuous-integration/drone/push Build is passing Details

pull/35/head^2
Roxane ROSSETTO 2 years ago
parent 1e46072b93
commit 474c038874

@ -37,7 +37,7 @@ namespace MCTGLib
{ {
throw new ArgumentNullException("Erreur pour la photo d'utilisateur!"); throw new ArgumentNullException("Erreur pour la photo d'utilisateur!");
} }
}
} }
/// <summary> /// <summary>
@ -67,15 +67,27 @@ namespace MCTGLib
{ {
if (string.IsNullOrWhiteSpace(value)) if (string.IsNullOrWhiteSpace(value))
{ {
throw new ArgumentNullException("Il y a une erreur de Prénom d'utilisateur"); throw new ArgumentNullException("Il y a une erreur de Prénom d'utilisateur.");
} }
surname = value; surname = value;
} }
} }
/// <summary>
/// Property to get mail of users and a setter
/// </summary>
/// <exception cref="ArgumentNullException" >User's mail will serve to log the user. So there's no setter, just an init. User will enter one time his email at his
/// account creation.</exception>
public string Mail public string Mail
{ {
get { return mail; } get { return mail; }
private set { mail = value; } init
{
if (string.IsNullOrWhiteSpace(value))
{
throw new ArgumentNullException("Il y a une erreur de Mail d'utilisateur.");
}
mail = value;
}
} }
@ -95,6 +107,9 @@ namespace MCTGLib
/// <summary> /// <summary>
/// Construtors of user. /// Construtors of user.
/// </summary> /// </summary>
/// <param name="name">The name of the user</param>
/// <param name="surname">The surname of the user</param>
/// <param name="mail">The user needs an email to login. </param>
public User(string name, string surname, string mail) public User(string name, string surname, string mail)
{ {
Name = name; Name = name;

Loading…
Cancel
Save