1
0
mirror of https://github.com/ppy/osu.git synced 2024-10-01 17:17:25 +08:00
osu-lazer/osu.Game.Tests/Visual/TestCaseUserProfile.cs

70 lines
2.5 KiB
C#
Raw Normal View History

2017-09-18 21:32:49 +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 System;
2017-12-22 17:58:35 +08:00
using System.Collections.Generic;
2017-09-18 21:32:49 +08:00
using System.Linq;
2017-12-22 17:58:35 +08:00
using osu.Game.Graphics.UserInterface;
2017-09-18 21:32:49 +08:00
using osu.Game.Overlays;
2017-12-22 17:58:35 +08:00
using osu.Game.Overlays.Profile;
2017-09-18 21:32:49 +08:00
using osu.Game.Users;
namespace osu.Game.Tests.Visual
{
2017-12-20 20:47:45 +08:00
public class TestCaseUserProfile : OsuTestCase
2017-09-18 21:32:49 +08:00
{
2017-12-22 17:58:35 +08:00
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(ProfileHeader),
typeof(UserProfileOverlay),
typeof(RankChart),
typeof(LineGraph),
};
2017-09-18 21:32:49 +08:00
public TestCaseUserProfile()
{
var profile = new UserProfileOverlay();
Add(profile);
AddStep("Show offline dummy", () => profile.ShowUser(new User
{
Username = @"Somebody",
Id = 1,
Country = new Country { FullName = @"Alien" },
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c1.jpg",
JoinDate = DateTimeOffset.Now.AddDays(-1),
LastVisit = DateTimeOffset.Now,
Age = 1,
ProfileOrder = new[] { "me" },
CountryRank = 1,
Statistics = new UserStatistics
{
Rank = 2148,
PP = 4567.89m
},
RankHistory = new User.RankHistoryData
{
Mode = @"osu",
Data = Enumerable.Range(2345, 45).Concat(Enumerable.Range(2109, 40)).ToArray()
}
}, false));
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);
}
}
}