-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Expand file tree
/
Copy pathTestSceneRankedPlayCornerPiece.cs
More file actions
62 lines (57 loc) · 2.33 KB
/
Copy pathTestSceneRankedPlayCornerPiece.cs
File metadata and controls
62 lines (57 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// 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 NUnit.Framework;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Testing;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay;
using osu.Game.Screens.OnlinePlay.Matchmaking.RankedPlay.Components;
using osu.Game.Tests.Visual.Multiplayer;
namespace osu.Game.Tests.Visual.RankedPlay
{
public partial class TestSceneRankedPlayCornerPiece : MultiplayerTestScene
{
private readonly Bindable<Visibility> visibility = new Bindable<Visibility>(Visibility.Visible);
public override void SetUpSteps()
{
base.SetUpSteps();
AddStep("add children", () =>
{
Children =
[
new RankedPlayCornerPiece(RankedPlayColourScheme.BLUE, Anchor.BottomLeft)
{
State = { BindTarget = visibility },
Child = new RankedPlayUserDisplay(new APIUser { Id = 2, Username = "peppy" }, Anchor.BottomLeft, RankedPlayColourScheme.BLUE)
{
RelativeSizeAxes = Axes.Both,
}
},
new RankedPlayCornerPiece(RankedPlayColourScheme.RED, Anchor.TopRight)
{
State = { BindTarget = visibility },
Child = new RankedPlayUserDisplay(new APIUser { Id = 2, Username = "peppy" }, Anchor.TopRight, RankedPlayColourScheme.RED)
{
RelativeSizeAxes = Axes.Both,
}
},
];
});
}
[Test]
public void TestCornerPieces()
{
AddStep("show", () => visibility.Value = Visibility.Visible);
AddStep("hide", () => visibility.Value = Visibility.Hidden);
AddSliderStep("health", 0, 1_000_000, 1_000_000, value =>
{
foreach (var d in this.ChildrenOfType<RankedPlayUserDisplay>())
{
d.Health.Value = value;
}
});
}
}
}