Add testcase

This commit is contained in:
smoogipoo
2018-11-12 19:41:06 +09:00
parent 1403fa26cf
commit 3d8ef97e81
7 changed files with 93 additions and 10 deletions

View File

@ -15,18 +15,14 @@ namespace osu.Game.Tests.Visual
[Cached(Type = typeof(IPlacementHandler))]
public abstract class PlacementBlueprintTestCase : OsuTestCase, IPlacementHandler
{
private readonly Container hitObjectContainer;
protected readonly Container HitObjectContainer;
private PlacementBlueprint currentBlueprint;
protected PlacementBlueprintTestCase()
{
Beatmap.Value.BeatmapInfo.BaseDifficulty.CircleSize = 2;
Add(hitObjectContainer = new Container
{
RelativeSizeAxes = Axes.Both,
Clock = new FramedClock(new StopwatchClock())
});
Add(HitObjectContainer = CreateHitObjectContainer());
}
[BackgroundDependencyLoader]
@ -49,7 +45,7 @@ namespace osu.Game.Tests.Visual
public void EndPlacement(HitObject hitObject)
{
hitObjectContainer.Add(CreateHitObject(hitObject));
AddHitObject(CreateHitObject(hitObject));
Remove(currentBlueprint);
Add(currentBlueprint = CreateBlueprint());
@ -59,6 +55,10 @@ namespace osu.Game.Tests.Visual
{
}
protected virtual Container CreateHitObjectContainer() => new Container { RelativeSizeAxes = Axes.Both };
protected virtual void AddHitObject(DrawableHitObject hitObject) => HitObjectContainer.Add(hitObject);
protected abstract DrawableHitObject CreateHitObject(HitObject hitObject);
protected abstract PlacementBlueprint CreateBlueprint();
}

View File

@ -24,6 +24,8 @@ namespace osu.Game.Tests.Visual
public double TimeRange { set => scrollingInfo.TimeRange.Value = value; }
public IScrollingInfo ScrollingInfo => scrollingInfo;
[Cached(Type = typeof(IScrollingInfo))]
private readonly TestScrollingInfo scrollingInfo = new TestScrollingInfo();