Add test coverage of animation restarting

This commit is contained in:
Dean Herbert 2020-11-19 18:07:41 +09:00
parent 84e73e88d5
commit dd5b90cf6c

View File

@ -13,17 +13,26 @@ namespace osu.Game.Tests.Visual.Gameplay
[TestFixture]
public class TestSceneParticleExplosion : OsuTestScene
{
private ParticleExplosion explosion;
[BackgroundDependencyLoader]
private void load(TextureStore textures)
{
AddRepeatStep(@"display", () =>
AddStep("create initial", () =>
{
Child = new ParticleExplosion(textures.Get("Cursor/cursortrail"), 150, 1200)
Child = explosion = new ParticleExplosion(textures.Get("Cursor/cursortrail"), 150, 1200)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(400)
};
});
AddWaitStep("wait for playback", 5);
AddRepeatStep(@"restart animation", () =>
{
explosion.Restart();
}, 10);
}
}