Add test case for UserPage.

This commit is contained in:
Huo Yaoyuan 2017-06-05 21:04:35 +08:00
parent 159e8d84c2
commit 1b8ef3bbbd
3 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,38 @@
// 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;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using osu.Framework.Graphics;
using osu.Framework.Testing;
using osu.Game.Overlays;
using osu.Game.Users;
namespace osu.Desktop.VisualTests.Tests
{
internal class TestCaseUserPage : TestCase
{
public override void Reset()
{
base.Reset();
var userpage = new UserPageOverlay(new User
{
Username = @"peppy",
Id = 2,
Country = new Country { FlagName = @"AU" },
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg"
})
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Width = 800,
Height = 500
};
Add(userpage);
AddStep("Toggle", userpage.ToggleVisibility);
}
}
}

View File

@ -210,6 +210,7 @@
<Compile Include="Tests\TestCasePlaySongSelect.cs" />
<Compile Include="Tests\TestCaseTooltip.cs" />
<Compile Include="Tests\TestCaseTwoLayerButton.cs" />
<Compile Include="Tests\TestCaseUserPage.cs" />
<Compile Include="VisualTestGame.cs" />
<Compile Include="Platform\TestStorage.cs" />
<Compile Include="Tests\TestCaseSettings.cs" />

View File

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface;
@ -24,6 +25,7 @@ namespace osu.Game.Users
var sections = new UserPageSection[] { };
var sectionsContainer = new SectionsContainer
{
RelativeSizeAxes = Axes.Both,
ExpandableHeader = new UserPageHeader(user),
FixedHeader = tab,
Sections = sections