Feat : Follow Game Test
continuous-integration/drone/push Build is passing Details

Popup_qui_marche_pas
Jade VAN BRABANDT 2 years ago
parent 306870dcbd
commit 803e9c08ce

@ -24,7 +24,16 @@ namespace Model
}
private string username;
public string Biographie { get; set; }
public string Biographie
{
get { return Biographie;}
private set
{
if (value == null || value == "") return;
biographie = value;
}
}
private string? biographie;
public string Email
{
@ -53,7 +62,11 @@ namespace Model
public int Role { get; }
private int role;
public List<Game> Followed_Games { get; set; }
public List<Game> Followed_Games
{
get;
private init;
}
public User(string username, string biographie, string email, string password)
{

@ -25,5 +25,16 @@ namespace Test
User user2 = new(null, "biographie", "adresse.mail@gmail.com", "Azerty123*");
Assert.Null(user.Username);
}
[Fact]
public void AddingGameToFollowed()
{
User user = new("username", "biographie", "adresse.mail@gmail.com", "Azerty123*");
Assert.Empty(user.Followed_Games);
Game game = new("name", "description", 2012, new string[] {"1","2","3"});
Assert.NotNull(game);
user.FollowAGame(game);
Assert.Single(user.Followed_Games);
}
}
}

Loading…
Cancel
Save