1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 03:47:26 +08:00
osu-lazer/osu.Game.Tests/Visual/Gameplay/TestSceneComboCounter.cs

40 lines
1.2 KiB
C#

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Testing;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Scoring;
using osu.Game.Screens.Play.HUD;
namespace osu.Game.Tests.Visual.Gameplay
{
public class TestSceneComboCounter : SkinnableTestScene
{
private IEnumerable<SkinnableComboCounter> comboCounters => CreatedDrawables.OfType<SkinnableComboCounter>();
protected override Ruleset CreateRulesetForSkinProvider() => new OsuRuleset();
[Cached]
private ScoreProcessor scoreProcessor = new ScoreProcessor();
[SetUpSteps]
public void SetUpSteps()
{
AddStep("Create combo counters", () => SetContents(() => new SkinnableComboCounter()));
}
[Test]
public void TestComboCounterIncrementing()
{
AddRepeatStep("increase combo", () => scoreProcessor.Combo.Value++, 10);
AddStep("reset combo", () => scoreProcessor.Combo.Value = 0);
}
}
}