Replace usage of .Result with .WaitSafelyForResult

This commit is contained in:
Dean Herbert
2022-01-03 17:31:12 +09:00
parent 031a40af6a
commit 73b40e6833
41 changed files with 121 additions and 68 deletions

View File

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Extensions;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Utils;
@ -43,7 +44,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
{
base.SetUpSteps();
AddStep("set local user", () => ((DummyAPIAccess)API).LocalUser.Value = LookupCache.GetUserAsync(1).Result);
AddStep("set local user", () => ((DummyAPIAccess)API).LocalUser.Value = LookupCache.GetUserAsync(1).WaitSafelyForResult());
AddStep("create leaderboard", () =>
{
@ -90,7 +91,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
public void TestUserQuit()
{
foreach (int user in users)
AddStep($"mark user {user} quit", () => Client.RemoveUser(LookupCache.GetUserAsync(user).Result.AsNonNull()));
AddStep($"mark user {user} quit", () => Client.RemoveUser(LookupCache.GetUserAsync(user).WaitSafelyForResult().AsNonNull()));
}
[Test]