2018-01-05 19:21:19 +08:00
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-11-29 15:30:59 +08:00
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
using System;
|
2018-03-19 19:14:46 +08:00
|
|
|
using System.Collections.Generic;
|
2018-03-02 14:34:31 +08:00
|
|
|
using NUnit.Framework;
|
2017-11-29 15:30:59 +08:00
|
|
|
using osu.Framework.Allocation;
|
2018-03-15 17:24:57 +08:00
|
|
|
using osu.Framework.Timing;
|
2018-03-16 22:53:46 +08:00
|
|
|
using osu.Game.Rulesets.Osu;
|
2017-11-29 15:30:59 +08:00
|
|
|
using osu.Game.Screens.Edit.Screens.Compose;
|
2018-03-16 22:53:46 +08:00
|
|
|
using osu.Game.Tests.Beatmaps;
|
2017-11-29 15:30:59 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual
|
|
|
|
{
|
2018-03-02 14:34:31 +08:00
|
|
|
[TestFixture]
|
2017-11-29 15:30:59 +08:00
|
|
|
public class TestCaseEditorCompose : OsuTestCase
|
|
|
|
{
|
2018-03-19 19:14:46 +08:00
|
|
|
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(Compose) };
|
2018-03-19 19:23:31 +08:00
|
|
|
|
2018-03-19 15:27:52 +08:00
|
|
|
private DependencyContainer dependencies;
|
2018-03-19 19:14:46 +08:00
|
|
|
|
2018-03-19 15:27:52 +08:00
|
|
|
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent)
|
|
|
|
=> dependencies = new DependencyContainer(parent);
|
2017-11-29 15:30:59 +08:00
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2018-03-16 22:53:46 +08:00
|
|
|
private void load(OsuGameBase osuGame)
|
2017-11-29 15:30:59 +08:00
|
|
|
{
|
2018-03-16 22:53:46 +08:00
|
|
|
osuGame.Beatmap.Value = new TestWorkingBeatmap(new OsuRuleset().RulesetInfo);
|
2017-11-29 15:30:59 +08:00
|
|
|
|
2018-03-16 22:53:46 +08:00
|
|
|
var clock = new DecoupleableInterpolatingFramedClock { IsCoupled = false };
|
2018-03-19 15:27:52 +08:00
|
|
|
dependencies.CacheAs<IAdjustableClock>(clock);
|
|
|
|
dependencies.CacheAs<IFrameBasedClock>(clock);
|
2017-11-29 15:30:59 +08:00
|
|
|
|
2018-03-19 15:27:52 +08:00
|
|
|
var compose = new Compose();
|
2017-11-29 15:30:59 +08:00
|
|
|
compose.Beatmap.BindTo(osuGame.Beatmap);
|
|
|
|
|
2018-03-16 22:53:46 +08:00
|
|
|
Child = compose;
|
2017-11-29 15:30:59 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|