diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneGameplayLeaderboard.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneGameplayLeaderboard.cs index 135c1fd50c..1787230117 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneGameplayLeaderboard.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneGameplayLeaderboard.cs @@ -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; diff --git a/osu.Game.Tests/Visual/Online/TestSceneDashboardOverlay.cs b/osu.Game.Tests/Visual/Online/TestSceneDashboardOverlay.cs index f2ea084f40..fb54e936bc 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneDashboardOverlay.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneDashboardOverlay.cs @@ -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 + } + }); } } diff --git a/osu.Game.Tests/Visual/Online/TestSceneUserProfileHeader.cs b/osu.Game.Tests/Visual/Online/TestSceneUserProfileHeader.cs index 725da655c3..9c368f6d73 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneUserProfileHeader.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneUserProfileHeader.cs @@ -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(() => { diff --git a/osu.Game/Tests/Visual/OsuTestScene.cs b/osu.Game/Tests/Visual/OsuTestScene.cs index 853c5d5f5c..09cfe5ecad 100644 --- a/osu.Game/Tests/Visual/OsuTestScene.cs +++ b/osu.Game/Tests/Visual/OsuTestScene.cs @@ -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));