mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 19:53:23 +08:00
Add online test
This commit is contained in:
parent
3ae0dd5751
commit
f81238b8b1
@ -2,8 +2,11 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Game.Online.API;
|
||||||
|
using osu.Game.Online.API.Requests;
|
||||||
using osu.Game.Overlays.Profile.Header;
|
using osu.Game.Overlays.Profile.Header;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
|
|
||||||
@ -12,10 +15,13 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestScenePreviousUsernamesContainer : OsuTestScene
|
public class TestScenePreviousUsernamesContainer : OsuTestScene
|
||||||
{
|
{
|
||||||
|
[Resolved]
|
||||||
|
private IAPIProvider api { get; set; }
|
||||||
|
|
||||||
|
private readonly Bindable<User> user = new Bindable<User>();
|
||||||
|
|
||||||
public TestScenePreviousUsernamesContainer()
|
public TestScenePreviousUsernamesContainer()
|
||||||
{
|
{
|
||||||
Bindable<User> user = new Bindable<User>();
|
|
||||||
|
|
||||||
Child = new PreviousUsernamesContainer
|
Child = new PreviousUsernamesContainer
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
@ -55,5 +61,17 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
|
|
||||||
AddStep("null user", () => user.Value = null);
|
AddStep("null user", () => user.Value = null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
AddStep("online user (Angelsim)", () =>
|
||||||
|
{
|
||||||
|
var request = new GetUserRequest(1777162);
|
||||||
|
request.Success += user => this.user.Value = user;
|
||||||
|
api.Queue(request);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user