osu/osu.Desktop.VisualTests/Tests/TestCaseBeatmapDetails.cs

64 lines
2.1 KiB
C#
Raw Normal View History

2017-03-25 22:33:03 +00: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 osu.Framework.Graphics;
2017-03-28 18:18:56 +00:00
using osu.Framework.Graphics.Primitives;
2017-03-29 13:51:54 +00:00
using osu.Framework.Testing;
2017-03-24 22:02:24 +00:00
using osu.Game.Database;
using osu.Game.Screens.Select;
using osu.Game.Screens.Select.Details;
2017-03-24 22:02:24 +00:00
using System;
using System.Linq;
namespace osu.Desktop.VisualTests.Tests
{
internal class TestCaseBeatmapDetails : TestCase
2017-03-24 22:02:24 +00:00
{
public override string Description => "BeatmapDetails tab of BeatmapDetailArea";
private BeatmapDetails details;
2017-03-24 22:02:24 +00:00
public override void Reset()
{
base.Reset();
Add(details = new BeatmapDetails
2017-03-24 22:02:24 +00:00
{
RelativeSizeAxes = Axes.Both,
2017-03-28 18:18:56 +00:00
Padding = new MarginPadding(150),
2017-03-25 22:33:03 +00:00
Beatmap = new BeatmapInfo
2017-03-24 22:02:24 +00:00
{
2017-03-25 22:33:03 +00:00
Version = "VisualTest",
Metadata = new BeatmapMetadata
{
Source = "Some guy",
Tags = "beatmap metadata example with a very very long list of tags and not much creativity",
},
Difficulty = new BeatmapDifficulty
{
CircleSize = 7,
ApproachRate = 3.5f,
OverallDifficulty = 5.7f,
DrainRate = 1,
},
StarDifficulty = 5.3f,
2017-03-24 22:02:24 +00:00
},
});
2017-03-28 18:18:56 +00:00
details.Ratings = Enumerable.Range(1, 10);
2017-03-29 13:37:51 +00:00
newRetryAndFailValues();
AddButton("new retry/fail values", newRetryAndFailValues);
}
private int lastRange = 1;
private void newRetryAndFailValues()
{
details.Fails = Enumerable.Range(lastRange, 100).Select(i => (int)(Math.Cos(i) * 100));
details.Retries = Enumerable.Range(lastRange, 100).Select(i => (int)(Math.Sin(i) * 100));
2017-03-29 13:37:51 +00:00
lastRange += 100;
2017-03-24 22:02:24 +00:00
}
}
}