From cd2fc3148e1f323d78a5540b680162f362bf964c Mon Sep 17 00:00:00 2001 From: Jorolf Date: Tue, 4 Apr 2017 18:10:57 +0200 Subject: [PATCH] added TestCaseGraphAndBar --- .../Tests/TestCaseGraphAndBar.cs | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseGraphAndBar.cs b/osu.Desktop.VisualTests/Tests/TestCaseGraphAndBar.cs index f43b6a557d..571a5031c8 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseGraphAndBar.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseGraphAndBar.cs @@ -1,11 +1,42 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using OpenTK; +using osu.Framework.Graphics; using osu.Framework.Testing; +using osu.Game.Graphics.UserInterface; +using System.Collections.Generic; +using System.Linq; namespace osu.Desktop.VisualTests.Tests { internal class TestCaseGraphAndBar : TestCase { + public override string Description => "graphs and bars, bars and graphs"; + + 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), + }, + }; + + AddStep("values from 1-10", () => graph.Values = Enumerable.Range(1,10).Select(i => (float)i)); + 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); + } } } \ No newline at end of file