Rewrite visualisation piece to bind once and without potential event leak

This commit is contained in:
Salman Ahmed
2023-01-07 14:30:01 +03:00
parent 904c76e437
commit abca13eb6c
2 changed files with 14 additions and 10 deletions

View File

@ -27,9 +27,9 @@ namespace osu.Game.Tests.Visual.Editing
public void TestScenePreviewTimeline()
{
AddStep("set preview time to -1", () => EditorBeatmap.PreviewTime.Value = -1);
AddAssert("preview time line should not show", () => Editor.ChildrenOfType<PreviewTimePart>().Single().Alpha == 0);
AddAssert("preview time line should not show", () => !Editor.ChildrenOfType<PreviewTimePart>().Single().Children.Any());
AddStep("set preview time to 1000", () => EditorBeatmap.PreviewTime.Value = 1000);
AddAssert("preview time line should show", () => Editor.ChildrenOfType<PreviewTimePart>().Single().Alpha == 1);
AddAssert("preview time line should show", () => Editor.ChildrenOfType<PreviewTimePart>().Single().Children.Single().Alpha == 1);
}
}
}