1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 02:37:25 +08:00
osu-lazer/osu.Game.Tests/Visual/TestCaseEditorSummaryTimeline.cs

52 lines
1.7 KiB
C#
Raw Normal View History

2018-01-05 19:21:19 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Collections.Generic;
2018-03-02 14:34:31 +08:00
using NUnit.Framework;
2018-03-19 15:27:52 +08:00
using osu.Framework.Allocation;
2017-09-20 16:16:12 +08:00
using osu.Framework.Graphics;
using osu.Game.Beatmaps;
2017-09-20 16:16:12 +08:00
using OpenTK;
2017-09-26 14:45:27 +08:00
using osu.Game.Screens.Edit.Components.Timelines.Summary;
using osu.Framework.Configuration;
2018-03-15 17:24:57 +08:00
using osu.Framework.Timing;
2018-03-19 15:27:52 +08:00
using osu.Game.Rulesets.Osu;
using osu.Game.Tests.Beatmaps;
namespace osu.Game.Tests.Visual
{
2018-03-02 14:34:31 +08:00
[TestFixture]
2017-12-20 20:47:45 +08:00
public class TestCaseEditorSummaryTimeline : OsuTestCase
{
2017-09-20 16:16:12 +08:00
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(SummaryTimeline) };
private readonly Bindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
2018-03-19 15:27:52 +08:00
private DependencyContainer dependencies;
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent)
=> dependencies = new DependencyContainer(parent);
[BackgroundDependencyLoader]
private void load()
{
2018-03-19 15:27:52 +08:00
beatmap.Value = new TestWorkingBeatmap(new OsuRuleset().RulesetInfo);
2018-03-15 17:24:57 +08:00
var clock = new DecoupleableInterpolatingFramedClock { IsCoupled = false };
2018-03-19 15:27:52 +08:00
dependencies.CacheAs<IAdjustableClock>(clock);
dependencies.CacheAs<IFrameBasedClock>(clock);
2018-03-15 17:24:57 +08:00
SummaryTimeline summaryTimeline;
2018-03-19 15:27:52 +08:00
Add(summaryTimeline = new SummaryTimeline
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(500, 50)
});
summaryTimeline.Beatmap.BindTo(beatmap);
}
}
}