mirror of
https://github.com/ppy/osu
synced 2025-04-11 03:31:46 +00:00
Add test case failing on selection after paste
This commit is contained in:
parent
1832f624e2
commit
2678089e0b
@ -3,12 +3,16 @@
|
|||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
|
using osu.Game.Rulesets.Edit;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using osu.Game.Rulesets.Osu;
|
using osu.Game.Rulesets.Osu;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
|
using osu.Game.Screens.Edit.Compose.Components;
|
||||||
|
using osu.Game.Screens.Edit.Compose.Components.Timeline;
|
||||||
using osu.Game.Tests.Beatmaps;
|
using osu.Game.Tests.Beatmaps;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
@ -110,8 +114,9 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
AddAssert("duration matches", () => ((Spinner)EditorBeatmap.HitObjects.Single()).Duration == 5000);
|
AddAssert("duration matches", () => ((Spinner)EditorBeatmap.HitObjects.Single()).Duration == 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[TestCase(false)]
|
||||||
public void TestCopyPaste()
|
[TestCase(true)]
|
||||||
|
public void TestCopyPaste(bool deselectAfterCopy)
|
||||||
{
|
{
|
||||||
var addedObject = new HitCircle { StartTime = 1000 };
|
var addedObject = new HitCircle { StartTime = 1000 };
|
||||||
|
|
||||||
@ -123,11 +128,22 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
|
|
||||||
AddStep("move forward in time", () => EditorClock.Seek(2000));
|
AddStep("move forward in time", () => EditorClock.Seek(2000));
|
||||||
|
|
||||||
|
if (deselectAfterCopy)
|
||||||
|
{
|
||||||
|
AddStep("deselect", () => EditorBeatmap.SelectedHitObjects.Clear());
|
||||||
|
|
||||||
|
AddUntilStep("timeline selection box is not visible", () => Editor.ChildrenOfType<Timeline>().First().ChildrenOfType<SelectionHandler>().First().Alpha == 0);
|
||||||
|
AddUntilStep("composer selection box is not visible", () => Editor.ChildrenOfType<HitObjectComposer>().First().ChildrenOfType<SelectionHandler>().First().Alpha == 0);
|
||||||
|
}
|
||||||
|
|
||||||
AddStep("paste hitobject", () => Editor.Paste());
|
AddStep("paste hitobject", () => Editor.Paste());
|
||||||
|
|
||||||
AddAssert("are two objects", () => EditorBeatmap.HitObjects.Count == 2);
|
AddAssert("are two objects", () => EditorBeatmap.HitObjects.Count == 2);
|
||||||
|
|
||||||
AddAssert("new object selected", () => EditorBeatmap.SelectedHitObjects.Single().StartTime == 2000);
|
AddAssert("new object selected", () => EditorBeatmap.SelectedHitObjects.Single().StartTime == 2000);
|
||||||
|
|
||||||
|
AddUntilStep("timeline selection box is visible", () => Editor.ChildrenOfType<Timeline>().First().ChildrenOfType<SelectionHandler>().First().Alpha > 0);
|
||||||
|
AddUntilStep("composer selection box is visible", () => Editor.ChildrenOfType<HitObjectComposer>().First().ChildrenOfType<SelectionHandler>().First().Alpha > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
Loading…
Reference in New Issue
Block a user