2017-06-05 21:04:35 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
2017-06-15 02:38:51 +08:00
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2017-06-05 21:04:35 +08:00
|
|
|
|
using osu.Framework.Testing;
|
2017-06-15 17:03:33 +08:00
|
|
|
|
using osu.Game.Overlays;
|
2017-06-05 21:04:35 +08:00
|
|
|
|
using osu.Game.Users;
|
|
|
|
|
|
|
|
|
|
namespace osu.Desktop.VisualTests.Tests
|
|
|
|
|
{
|
2017-06-05 21:07:57 +08:00
|
|
|
|
internal class TestCaseUserProfile : TestCase
|
2017-06-05 21:04:35 +08:00
|
|
|
|
{
|
2017-06-05 21:20:04 +08:00
|
|
|
|
public override string Description => "Tests user's profile page.";
|
|
|
|
|
|
2017-06-05 21:04:35 +08:00
|
|
|
|
public override void Reset()
|
|
|
|
|
{
|
|
|
|
|
base.Reset();
|
2017-06-15 20:01:46 +08:00
|
|
|
|
var profile = new UserProfileOverlay
|
2017-06-05 21:04:35 +08:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
2017-06-15 02:38:51 +08:00
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Padding = new MarginPadding { Horizontal = 50 },
|
2017-06-05 21:04:35 +08:00
|
|
|
|
};
|
2017-06-15 20:01:46 +08:00
|
|
|
|
Add(profile);
|
|
|
|
|
|
|
|
|
|
AddStep("Show ppy", () => profile.ShowUser(new User
|
|
|
|
|
{
|
|
|
|
|
Username = @"peppy",
|
|
|
|
|
Id = 2,
|
|
|
|
|
Country = new Country { FullName = @"Australia", FlagName = @"AU" },
|
|
|
|
|
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg"
|
|
|
|
|
}));
|
|
|
|
|
AddStep("Show flyte", () => profile.ShowUser(new User
|
|
|
|
|
{
|
|
|
|
|
Username = @"flyte",
|
|
|
|
|
Id = 3103765,
|
|
|
|
|
Country = new Country { FullName = @"Japan", FlagName = @"JP" },
|
|
|
|
|
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c6.jpg"
|
|
|
|
|
}));
|
|
|
|
|
AddStep("Hide", profile.Hide);
|
|
|
|
|
AddStep("Show without reload", profile.Show);
|
2017-06-05 21:04:35 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|