mirror of
https://github.com/osukey/osukey.git
synced 2025-05-09 23:57:18 +09:00
Fix incorrect usages of user lookup cache in tests
This commit is contained in:
parent
2675bb87ff
commit
539cbe62c6
@ -39,7 +39,8 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private OsuGameBase game { get; set; }
|
private OsuGameBase game { get; set; }
|
||||||
|
|
||||||
private TestSpectatorClient spectatorClient;
|
private TestSpectatorClient spectatorClient => dependenciesScreen.Client;
|
||||||
|
private DependenciesScreen dependenciesScreen;
|
||||||
private SoloSpectator spectatorScreen;
|
private SoloSpectator spectatorScreen;
|
||||||
|
|
||||||
private BeatmapSetInfo importedBeatmap;
|
private BeatmapSetInfo importedBeatmap;
|
||||||
@ -48,16 +49,16 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
[SetUpSteps]
|
[SetUpSteps]
|
||||||
public void SetupSteps()
|
public void SetupSteps()
|
||||||
{
|
{
|
||||||
DependenciesScreen dependenciesScreen = null;
|
|
||||||
|
|
||||||
AddStep("load dependencies", () =>
|
AddStep("load dependencies", () =>
|
||||||
{
|
{
|
||||||
spectatorClient = new TestSpectatorClient();
|
LoadScreen(dependenciesScreen = new DependenciesScreen());
|
||||||
|
|
||||||
// The screen gets suspended so it stops receiving updates.
|
// The dependencies screen gets suspended so it stops receiving updates. So its children are manually added to the test scene instead.
|
||||||
Child = spectatorClient;
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
LoadScreen(dependenciesScreen = new DependenciesScreen(spectatorClient));
|
dependenciesScreen.UserLookupCache,
|
||||||
|
dependenciesScreen.Client,
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep("wait for dependencies to load", () => dependenciesScreen.IsLoaded);
|
AddUntilStep("wait for dependencies to load", () => dependenciesScreen.IsLoaded);
|
||||||
@ -335,12 +336,10 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
private class DependenciesScreen : OsuScreen
|
private class DependenciesScreen : OsuScreen
|
||||||
{
|
{
|
||||||
[Cached(typeof(SpectatorClient))]
|
[Cached(typeof(SpectatorClient))]
|
||||||
public readonly TestSpectatorClient Client;
|
public readonly TestSpectatorClient Client = new TestSpectatorClient();
|
||||||
|
|
||||||
public DependenciesScreen(TestSpectatorClient client)
|
[Cached(typeof(UserLookupCache))]
|
||||||
{
|
public readonly TestUserLookupCache UserLookupCache = new TestUserLookupCache();
|
||||||
Client = client;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,6 @@ using osu.Framework.Platform;
|
|||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Database;
|
|
||||||
using osu.Game.Online.Multiplayer;
|
using osu.Game.Online.Multiplayer;
|
||||||
using osu.Game.Online.Rooms;
|
using osu.Game.Online.Rooms;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
@ -41,9 +40,6 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
|
|
||||||
protected TestMultiplayerClient Client => multiplayerComponents.Client;
|
protected TestMultiplayerClient Client => multiplayerComponents.Client;
|
||||||
|
|
||||||
[Cached(typeof(UserLookupCache))]
|
|
||||||
private UserLookupCache lookupCache = new TestUserLookupCache();
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(GameHost host, AudioManager audio)
|
private void load(GameHost host, AudioManager audio)
|
||||||
{
|
{
|
||||||
|
@ -30,16 +30,13 @@ using osuTK.Input;
|
|||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Multiplayer
|
namespace osu.Game.Tests.Visual.Multiplayer
|
||||||
{
|
{
|
||||||
public class TestSceneDrawableRoomPlaylist : OsuManualInputManagerTestScene
|
public class TestSceneDrawableRoomPlaylist : MultiplayerTestScene
|
||||||
{
|
{
|
||||||
private TestPlaylist playlist;
|
private TestPlaylist playlist;
|
||||||
|
|
||||||
private BeatmapManager manager;
|
private BeatmapManager manager;
|
||||||
private RulesetStore rulesets;
|
private RulesetStore rulesets;
|
||||||
|
|
||||||
[Cached(typeof(UserLookupCache))]
|
|
||||||
private readonly TestUserLookupCache userLookupCache = new TestUserLookupCache();
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(GameHost host, AudioManager audio)
|
private void load(GameHost host, AudioManager audio)
|
||||||
{
|
{
|
||||||
|
@ -17,7 +17,6 @@ using osu.Framework.Screens;
|
|||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Database;
|
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
@ -56,9 +55,6 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
private TestMultiplayerClient client => multiplayerComponents.Client;
|
private TestMultiplayerClient client => multiplayerComponents.Client;
|
||||||
private TestMultiplayerRoomManager roomManager => multiplayerComponents.RoomManager;
|
private TestMultiplayerRoomManager roomManager => multiplayerComponents.RoomManager;
|
||||||
|
|
||||||
[Cached(typeof(UserLookupCache))]
|
|
||||||
private UserLookupCache lookupCache = new TestUserLookupCache();
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(GameHost host, AudioManager audio)
|
private void load(GameHost host, AudioManager audio)
|
||||||
{
|
{
|
||||||
|
@ -12,7 +12,6 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Database;
|
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Online.Multiplayer;
|
using osu.Game.Online.Multiplayer;
|
||||||
using osu.Game.Online.Rooms;
|
using osu.Game.Online.Rooms;
|
||||||
@ -26,9 +25,6 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
{
|
{
|
||||||
public class TestSceneMultiplayerQueueList : MultiplayerTestScene
|
public class TestSceneMultiplayerQueueList : MultiplayerTestScene
|
||||||
{
|
{
|
||||||
[Cached(typeof(UserLookupCache))]
|
|
||||||
private readonly TestUserLookupCache userLookupCache = new TestUserLookupCache();
|
|
||||||
|
|
||||||
private MultiplayerQueueList playlist;
|
private MultiplayerQueueList playlist;
|
||||||
private BeatmapManager beatmaps;
|
private BeatmapManager beatmaps;
|
||||||
private RulesetStore rulesets;
|
private RulesetStore rulesets;
|
||||||
|
@ -4,13 +4,11 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Beatmaps.Drawables;
|
using osu.Game.Beatmaps.Drawables;
|
||||||
using osu.Game.Database;
|
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Models;
|
using osu.Game.Models;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
@ -20,18 +18,16 @@ using osu.Game.Rulesets.Osu.Mods;
|
|||||||
using osu.Game.Screens.OnlinePlay;
|
using osu.Game.Screens.OnlinePlay;
|
||||||
using osu.Game.Screens.OnlinePlay.Playlists;
|
using osu.Game.Screens.OnlinePlay.Playlists;
|
||||||
using osu.Game.Tests.Beatmaps;
|
using osu.Game.Tests.Beatmaps;
|
||||||
|
using osu.Game.Tests.Visual.OnlinePlay;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Input;
|
using osuTK.Input;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Multiplayer
|
namespace osu.Game.Tests.Visual.Multiplayer
|
||||||
{
|
{
|
||||||
public class TestScenePlaylistsRoomSettingsPlaylist : OsuManualInputManagerTestScene
|
public class TestScenePlaylistsRoomSettingsPlaylist : OnlinePlayTestScene
|
||||||
{
|
{
|
||||||
private TestPlaylist playlist;
|
private TestPlaylist playlist;
|
||||||
|
|
||||||
[Cached(typeof(UserLookupCache))]
|
|
||||||
private readonly TestUserLookupCache userLookupCache = new TestUserLookupCache();
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestItemRemovedOnDeletion()
|
public void TestItemRemovedOnDeletion()
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,6 @@ using osu.Framework.Extensions;
|
|||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Database;
|
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Online.Multiplayer;
|
using osu.Game.Online.Multiplayer;
|
||||||
using osu.Game.Online.Multiplayer.MatchTypes.TeamVersus;
|
using osu.Game.Online.Multiplayer.MatchTypes.TeamVersus;
|
||||||
@ -36,9 +35,6 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
|
|
||||||
private TestMultiplayerClient client => multiplayerComponents.Client;
|
private TestMultiplayerClient client => multiplayerComponents.Client;
|
||||||
|
|
||||||
[Cached(typeof(UserLookupCache))]
|
|
||||||
private UserLookupCache lookupCache = new TestUserLookupCache();
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(GameHost host, AudioManager audio)
|
private void load(GameHost host, AudioManager audio)
|
||||||
{
|
{
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
|
using osu.Game.Database;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.Multiplayer;
|
using osu.Game.Online.Multiplayer;
|
||||||
using osu.Game.Screens;
|
using osu.Game.Screens;
|
||||||
@ -39,6 +40,12 @@ namespace osu.Game.Tests.Visual
|
|||||||
[Cached(typeof(MultiplayerClient))]
|
[Cached(typeof(MultiplayerClient))]
|
||||||
public readonly TestMultiplayerClient Client;
|
public readonly TestMultiplayerClient Client;
|
||||||
|
|
||||||
|
[Cached(typeof(UserLookupCache))]
|
||||||
|
private readonly UserLookupCache userLookupCache = new TestUserLookupCache();
|
||||||
|
|
||||||
|
[Cached]
|
||||||
|
private readonly BeatmapLookupCache beatmapLookupCache = new BeatmapLookupCache();
|
||||||
|
|
||||||
private readonly OsuScreenStack screenStack;
|
private readonly OsuScreenStack screenStack;
|
||||||
private readonly TestMultiplayer multiplayerScreen;
|
private readonly TestMultiplayer multiplayerScreen;
|
||||||
|
|
||||||
@ -48,6 +55,8 @@ namespace osu.Game.Tests.Visual
|
|||||||
|
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
|
userLookupCache,
|
||||||
|
beatmapLookupCache,
|
||||||
Client = new TestMultiplayerClient(RoomManager),
|
Client = new TestMultiplayerClient(RoomManager),
|
||||||
screenStack = new OsuScreenStack
|
screenStack = new OsuScreenStack
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user