Add tests for CommentsPage

This commit is contained in:
Andrei Zavatski
2020-01-29 06:44:39 +03:00
parent e7964023ae
commit dc10e58b4f
5 changed files with 184 additions and 14 deletions

View File

@ -47,17 +47,25 @@ namespace osu.Game.Online.API.Requests.Responses
[JsonProperty(@"included_comments")]
public List<Comment> IncludedComments { get; set; }
private List<long> userVotes;
[JsonProperty(@"user_votes")]
private List<long> userVotes
public List<long> UserVotes
{
set => value.ForEach(v =>
get => userVotes;
set
{
Comments.ForEach(c =>
userVotes = value;
value.ForEach(v =>
{
if (v == c.Id)
c.IsVoted = true;
Comments.ForEach(c =>
{
if (v == c.Id)
c.IsVoted = true;
});
});
});
}
}
private List<User> users;