mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
Add back inadvertently removed spacing
This commit is contained in:
parent
dafbeda681
commit
70bc0b2bd0
@ -64,7 +64,9 @@ namespace osu.Game.Tests.Beatmaps
|
||||
public void TestInitialHitObjectStartTimeChangeEvent()
|
||||
{
|
||||
var hitCircle = new HitCircle();
|
||||
|
||||
HitObject changedObject = null;
|
||||
|
||||
AddStep("add beatmap", () =>
|
||||
{
|
||||
EditorBeatmap editorBeatmap;
|
||||
@ -72,6 +74,7 @@ namespace osu.Game.Tests.Beatmaps
|
||||
Child = editorBeatmap = new EditorBeatmap(new OsuBeatmap { HitObjects = { hitCircle } });
|
||||
editorBeatmap.HitObjectUpdated += h => changedObject = h;
|
||||
});
|
||||
|
||||
AddStep("change start time", () => hitCircle.StartTime = 1000);
|
||||
AddAssert("received change event", () => changedObject == hitCircle);
|
||||
}
|
||||
@ -85,14 +88,18 @@ namespace osu.Game.Tests.Beatmaps
|
||||
{
|
||||
EditorBeatmap editorBeatmap = null;
|
||||
HitObject changedObject = null;
|
||||
|
||||
AddStep("add beatmap", () =>
|
||||
{
|
||||
Child = editorBeatmap = new EditorBeatmap(new OsuBeatmap());
|
||||
editorBeatmap.HitObjectUpdated += h => changedObject = h;
|
||||
});
|
||||
|
||||
var hitCircle = new HitCircle();
|
||||
|
||||
AddStep("add object", () => editorBeatmap.Add(hitCircle));
|
||||
AddAssert("event not received", () => changedObject == null);
|
||||
|
||||
AddStep("change start time", () => hitCircle.StartTime = 1000);
|
||||
AddAssert("event received", () => changedObject == hitCircle);
|
||||
}
|
||||
@ -105,10 +112,13 @@ namespace osu.Game.Tests.Beatmaps
|
||||
{
|
||||
var hitCircle = new HitCircle();
|
||||
var editorBeatmap = new EditorBeatmap(new OsuBeatmap { HitObjects = { hitCircle } });
|
||||
|
||||
HitObject changedObject = null;
|
||||
editorBeatmap.HitObjectUpdated += h => changedObject = h;
|
||||
|
||||
editorBeatmap.Remove(hitCircle);
|
||||
Assert.That(changedObject, Is.Null);
|
||||
|
||||
hitCircle.StartTime = 1000;
|
||||
Assert.That(changedObject, Is.Null);
|
||||
}
|
||||
@ -170,6 +180,7 @@ namespace osu.Game.Tests.Beatmaps
|
||||
var updatedObjects = new List<HitObject>();
|
||||
var allHitObjects = new List<HitObject>();
|
||||
EditorBeatmap editorBeatmap = null;
|
||||
|
||||
AddStep("add beatmap", () =>
|
||||
{
|
||||
updatedObjects.Clear();
|
||||
@ -183,9 +194,11 @@ namespace osu.Game.Tests.Beatmaps
|
||||
allHitObjects.Add(h);
|
||||
}
|
||||
});
|
||||
|
||||
AddStep("change all start times", () =>
|
||||
{
|
||||
editorBeatmap.HitObjectUpdated += h => updatedObjects.Add(h);
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
allHitObjects[i].StartTime += 10;
|
||||
});
|
||||
@ -202,6 +215,7 @@ namespace osu.Game.Tests.Beatmaps
|
||||
{
|
||||
var updatedObjects = new List<HitObject>();
|
||||
EditorBeatmap editorBeatmap = null;
|
||||
|
||||
AddStep("add beatmap", () =>
|
||||
{
|
||||
updatedObjects.Clear();
|
||||
@ -209,12 +223,15 @@ namespace osu.Game.Tests.Beatmaps
|
||||
Child = editorBeatmap = new EditorBeatmap(new OsuBeatmap());
|
||||
editorBeatmap.Add(new HitCircle());
|
||||
});
|
||||
|
||||
AddStep("change start time twice", () =>
|
||||
{
|
||||
editorBeatmap.HitObjectUpdated += h => updatedObjects.Add(h);
|
||||
|
||||
editorBeatmap.HitObjects[0].StartTime = 10;
|
||||
editorBeatmap.HitObjects[0].StartTime = 20;
|
||||
});
|
||||
|
||||
AddAssert("only updated once", () => updatedObjects.Count == 1);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user