mirror of
https://github.com/ppy/osu.git
synced 2024-11-08 06:00:05 +08:00
53 lines
1.7 KiB
C#
53 lines
1.7 KiB
C#
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|||
|
// See the LICENCE file in the repository root for full licence text.
|
|||
|
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using osu.Framework.Bindables;
|
|||
|
using osu.Framework.Graphics;
|
|||
|
using osu.Game.Overlays.Rankings;
|
|||
|
using osu.Game.Rulesets;
|
|||
|
using osu.Game.Users;
|
|||
|
|
|||
|
namespace osu.Game.Tests.Visual.Online
|
|||
|
{
|
|||
|
public class TestSceneRankingsHeader : OsuTestScene
|
|||
|
{
|
|||
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
|||
|
{
|
|||
|
typeof(HeaderFlag),
|
|||
|
typeof(HeaderTitle),
|
|||
|
typeof(RankingsRulesetSelector),
|
|||
|
typeof(RankingsScopeSelector),
|
|||
|
typeof(RankingsHeader),
|
|||
|
};
|
|||
|
|
|||
|
public TestSceneRankingsHeader()
|
|||
|
{
|
|||
|
var countryBindable = new Bindable<Country>();
|
|||
|
var ruleset = new Bindable<RulesetInfo>();
|
|||
|
var scope = new Bindable<RankingsScope>();
|
|||
|
|
|||
|
Add(new RankingsHeader
|
|||
|
{
|
|||
|
Anchor = Anchor.Centre,
|
|||
|
Origin = Anchor.Centre,
|
|||
|
Scope = { BindTarget = scope },
|
|||
|
Country = { BindTarget = countryBindable },
|
|||
|
Ruleset = { BindTarget = ruleset },
|
|||
|
});
|
|||
|
|
|||
|
var country = new Country
|
|||
|
{
|
|||
|
FlagName = "BY",
|
|||
|
FullName = "Belarus"
|
|||
|
};
|
|||
|
|
|||
|
AddStep("Set country", () => countryBindable.Value = country);
|
|||
|
AddAssert("Check scope is Performance", () => scope.Value == RankingsScope.Performance);
|
|||
|
AddStep("Set scope to Score", () => scope.Value = RankingsScope.Score);
|
|||
|
AddAssert("Check country is Null", () => countryBindable.Value == null);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|