mirror of https://github.com/ppy/osu
remove CreateAPIRelationFromAPIUser
This commit is contained in:
parent
fbe6077ec2
commit
1a92e5ad19
|
@ -155,7 +155,13 @@ public void TestFriendScore()
|
|||
var api = (DummyAPIAccess)API;
|
||||
|
||||
api.Friends.Clear();
|
||||
api.Friends.Add(CreateAPIRelationFromAPIUser(friend));
|
||||
api.Friends.Add(new APIRelation
|
||||
{
|
||||
Mutual = true,
|
||||
RelationType = RelationType.Friend,
|
||||
TargetID = friend.OnlineID,
|
||||
TargetUser = friend
|
||||
});
|
||||
});
|
||||
|
||||
int playerNumber = 1;
|
||||
|
|
|
@ -30,15 +30,21 @@ private void load()
|
|||
if (supportLevel > 3)
|
||||
supportLevel = 0;
|
||||
|
||||
((DummyAPIAccess)API).Friends.Add(CreateAPIRelationFromAPIUser(new APIUser
|
||||
((DummyAPIAccess)API).Friends.Add(new APIRelation
|
||||
{
|
||||
Username = @"peppy",
|
||||
Id = 2,
|
||||
Colour = "99EB47",
|
||||
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg",
|
||||
IsSupporter = supportLevel > 0,
|
||||
SupportLevel = supportLevel
|
||||
}));
|
||||
TargetID = 2,
|
||||
RelationType = RelationType.Friend,
|
||||
Mutual = true,
|
||||
TargetUser = new APIUser
|
||||
{
|
||||
Username = @"peppy",
|
||||
Id = 2,
|
||||
Colour = "99EB47",
|
||||
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg",
|
||||
IsSupporter = supportLevel > 0,
|
||||
SupportLevel = supportLevel
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -431,7 +431,13 @@ public void TestAddFriend()
|
|||
if (req.TargetId != nonFriend.OnlineID)
|
||||
return false;
|
||||
|
||||
var apiRelation = CreateAPIRelationFromAPIUser(nonFriend);
|
||||
var apiRelation = new APIRelation
|
||||
{
|
||||
TargetID = nonFriend.OnlineID,
|
||||
Mutual = true,
|
||||
RelationType = RelationType.Friend,
|
||||
TargetUser = nonFriend
|
||||
};
|
||||
|
||||
Task.Run(() =>
|
||||
{
|
||||
|
@ -465,8 +471,13 @@ public void TestAddFriendNonMutual()
|
|||
if (req.TargetId != nonFriend.OnlineID)
|
||||
return false;
|
||||
|
||||
var apiRelation = CreateAPIRelationFromAPIUser(nonFriend);
|
||||
apiRelation.Mutual = false;
|
||||
var apiRelation = new APIRelation
|
||||
{
|
||||
TargetID = nonFriend.OnlineID,
|
||||
Mutual = false,
|
||||
RelationType = RelationType.Friend,
|
||||
TargetUser = nonFriend
|
||||
};
|
||||
|
||||
Task.Run(() =>
|
||||
{
|
||||
|
|
|
@ -317,15 +317,6 @@ public static APIBeatmapSet CreateAPIBeatmapSet(IBeatmapInfo original)
|
|||
return result;
|
||||
}
|
||||
|
||||
public static APIRelation CreateAPIRelationFromAPIUser(APIUser user) =>
|
||||
new APIRelation
|
||||
{
|
||||
Mutual = true,
|
||||
RelationType = RelationType.Friend,
|
||||
TargetID = user.OnlineID,
|
||||
TargetUser = user
|
||||
};
|
||||
|
||||
protected WorkingBeatmap CreateWorkingBeatmap(RulesetInfo ruleset) =>
|
||||
CreateWorkingBeatmap(CreateBeatmap(ruleset));
|
||||
|
||||
|
|
Loading…
Reference in New Issue