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
|
|
|
|
|
|
2017-04-05 00:10:57 +08:00
|
|
|
|
using OpenTK;
|
|
|
|
|
using osu.Framework.Graphics;
|
2017-04-04 23:27:08 +08:00
|
|
|
|
using osu.Framework.Testing;
|
2017-04-05 00:10:57 +08:00
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
|
|
|
|
using System.Linq;
|
2017-04-04 23:27:08 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Desktop.VisualTests.Tests
|
|
|
|
|
{
|
2017-04-11 20:02:56 +08:00
|
|
|
|
internal class TestCaseGraph : TestCase
|
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
|
|
|
|
|
|
|
|
|
private BarGraph graph;
|
|
|
|
|
|
|
|
|
|
public override void Reset()
|
|
|
|
|
{
|
|
|
|
|
base.Reset();
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
}
|