Fix incorrect DI usage of IAPIProvider in many tests

This commit is contained in:
Dean Herbert
2019-09-13 17:15:33 +09:00
parent 0231984127
commit 7cb79dd760
14 changed files with 44 additions and 29 deletions

View File

@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Game.Online.API;
using osu.Game.Screens.Menu;
using osu.Game.Users;
@ -11,17 +10,17 @@ namespace osu.Game.Tests.Visual.Menus
public class TestSceneDisclaimer : ScreenTestScene
{
[BackgroundDependencyLoader]
private void load(IAPIProvider api)
private void load()
{
AddStep("load disclaimer", () => LoadScreen(new Disclaimer()));
AddStep("toggle support", () =>
{
api.LocalUser.Value = new User
API.LocalUser.Value = new User
{
Username = api.LocalUser.Value.Username,
Id = api.LocalUser.Value.Id,
IsSupporter = !api.LocalUser.Value.IsSupporter,
Username = API.LocalUser.Value.Username,
Id = API.LocalUser.Value.Id,
IsSupporter = !API.LocalUser.Value.IsSupporter,
};
});
}