1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-19 19:22:55 +08:00
osu-lazer/osu.Desktop.Tests/Visual/TestCaseGraph.cs

39 lines
1.5 KiB
C#
Raw Normal View History

2017-04-04 23:27:08 +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.Linq;
2017-04-05 00:10:57 +08:00
using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface;
using OpenTK;
2017-04-04 23:27:08 +08:00
namespace osu.Desktop.Tests.Visual
2017-04-04 23:27:08 +08:00
{
internal class TestCaseGraph : OsuTestCase
2017-04-04 23:27:08 +08:00
{
2017-04-11 20:02:56 +08:00
public override string Description => "graph";
2017-04-05 00:10:57 +08:00
public TestCaseGraph()
2017-04-05 00:10:57 +08:00
{
2017-07-08 17:17:47 +08:00
BarGraph graph;
2017-04-05 00:10:57 +08:00
Children = new[]
{
graph = new BarGraph
{
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(0.5f),
},
};
2017-06-08 14:35:10 +08:00
AddStep("values from 1-10", () => graph.Values = Enumerable.Range(1, 10).Select(i => (float)i));
2017-04-11 20:02:56 +08:00
AddStep("values from 1-100", () => graph.Values = Enumerable.Range(1, 100).Select(i => (float)i));
2017-04-05 00:10:57 +08:00
AddStep("reversed values from 1-10", () => graph.Values = Enumerable.Range(1, 10).Reverse().Select(i => (float)i));
AddStep("Bottom to top", () => graph.Direction = BarDirection.BottomToTop);
AddStep("Top to bottom", () => graph.Direction = BarDirection.TopToBottom);
AddStep("Left to right", () => graph.Direction = BarDirection.LeftToRight);
AddStep("Right to left", () => graph.Direction = BarDirection.RightToLeft);
}
2017-04-04 23:27:08 +08:00
}
}