1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 22:35:23 +08:00

Add online test

This commit is contained in:
Andrei Zavatski 2019-08-03 04:45:41 +03:00
parent 3ae0dd5751
commit f81238b8b1

View File

@ -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);
});
}
} }
} }