// Copyright (c) ppy Pty Ltd . 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 RequiredTypes => new[] { typeof(HeaderFlag), typeof(HeaderTitle), typeof(RankingsRulesetSelector), typeof(RankingsScopeSelector), typeof(RankingsHeader), }; public TestSceneRankingsHeader() { var countryBindable = new Bindable(); var ruleset = new Bindable(); var scope = new Bindable(); 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); } } }