mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 00:53:56 +09:00
Move test request handling earlier in setup
This commit is contained in:
@ -60,24 +60,16 @@ namespace osu.Game.Tests.Visual.OnlinePlay
|
|||||||
drawableDependenciesContainer.Clear();
|
drawableDependenciesContainer.Clear();
|
||||||
dependencies.OnlinePlayDependencies = CreateOnlinePlayDependencies();
|
dependencies.OnlinePlayDependencies = CreateOnlinePlayDependencies();
|
||||||
drawableDependenciesContainer.AddRange(OnlinePlayDependencies.DrawableComponents);
|
drawableDependenciesContainer.AddRange(OnlinePlayDependencies.DrawableComponents);
|
||||||
|
|
||||||
|
var handler = OnlinePlayDependencies.RequestsHandler;
|
||||||
|
|
||||||
|
// Resolving the BeatmapManager in the test scene will inject the game-wide BeatmapManager, while many test scenes cache their own BeatmapManager instead.
|
||||||
|
// To get around this, the BeatmapManager is looked up from the dependencies provided to the children of the test scene instead.
|
||||||
|
var beatmapManager = dependencies.Get<BeatmapManager>();
|
||||||
|
|
||||||
|
((DummyAPIAccess)API).HandleRequest = request => handler.HandleRequest(request, API.LocalUser.Value, beatmapManager);
|
||||||
});
|
});
|
||||||
|
|
||||||
public override void SetUpSteps()
|
|
||||||
{
|
|
||||||
base.SetUpSteps();
|
|
||||||
|
|
||||||
AddStep("setup API", () =>
|
|
||||||
{
|
|
||||||
var handler = OnlinePlayDependencies.RequestsHandler;
|
|
||||||
|
|
||||||
// Resolving the BeatmapManager in the test scene will inject the game-wide BeatmapManager, while many test scenes cache their own BeatmapManager instead.
|
|
||||||
// To get around this, the BeatmapManager is looked up from the dependencies provided to the children of the test scene instead.
|
|
||||||
var beatmapManager = dependencies.Get<BeatmapManager>();
|
|
||||||
|
|
||||||
((DummyAPIAccess)API).HandleRequest = request => handler.HandleRequest(request, API.LocalUser.Value, beatmapManager);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates the room dependencies. Called every <see cref="Setup"/>.
|
/// Creates the room dependencies. Called every <see cref="Setup"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Reference in New Issue
Block a user