2020-05-19 14:28:13 +00:00
|
|
|
|
// 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.
|
|
|
|
|
|
2020-12-20 17:25:49 +00:00
|
|
|
|
using System.Collections.Generic;
|
2020-05-19 14:28:13 +00:00
|
|
|
|
using System.Linq;
|
2023-06-30 06:38:24 +00:00
|
|
|
|
using NUnit.Framework;
|
2020-05-20 01:14:08 +00:00
|
|
|
|
using osu.Framework.Testing;
|
2020-05-19 14:28:13 +00:00
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Rulesets.Taiko.Objects.Drawables;
|
2023-06-30 06:38:24 +00:00
|
|
|
|
using osu.Game.Rulesets.Taiko.UI;
|
2020-05-19 14:28:13 +00:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Tests
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2023-06-30 06:38:24 +00:00
|
|
|
|
/// Taiko doesn't output any samples. They are all handled externally by <see cref="DrumSamplePlayer"/>.
|
2020-05-19 14:28:13 +00:00
|
|
|
|
/// </summary>
|
2020-05-20 01:14:08 +00:00
|
|
|
|
[HeadlessTest]
|
2020-06-03 19:00:02 +00:00
|
|
|
|
public partial class TestSceneSampleOutput : TestSceneTaikoPlayer
|
2020-05-19 14:28:13 +00:00
|
|
|
|
{
|
|
|
|
|
public override void SetUpSteps()
|
|
|
|
|
{
|
|
|
|
|
base.SetUpSteps();
|
2020-12-20 17:25:49 +00:00
|
|
|
|
|
2021-10-27 04:09:30 +00:00
|
|
|
|
string[] expectedSampleNames =
|
2020-12-20 17:25:49 +00:00
|
|
|
|
{
|
|
|
|
|
string.Empty,
|
|
|
|
|
string.Empty,
|
|
|
|
|
string.Empty,
|
|
|
|
|
string.Empty,
|
2023-06-30 06:38:24 +00:00
|
|
|
|
string.Empty,
|
|
|
|
|
string.Empty,
|
|
|
|
|
string.Empty,
|
|
|
|
|
string.Empty,
|
2020-12-20 17:25:49 +00:00
|
|
|
|
};
|
2021-10-27 04:09:30 +00:00
|
|
|
|
|
2020-12-20 17:25:49 +00:00
|
|
|
|
var actualSampleNames = new List<string>();
|
|
|
|
|
|
|
|
|
|
// due to pooling we can't access all samples right away due to object re-use,
|
|
|
|
|
// so we need to collect as we go.
|
|
|
|
|
AddStep("collect sample names", () => Player.DrawableRuleset.Playfield.NewResult += (dho, _) =>
|
2020-05-19 14:28:13 +00:00
|
|
|
|
{
|
2020-12-20 17:25:49 +00:00
|
|
|
|
if (!(dho is DrawableHit h))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
actualSampleNames.Add(string.Join(',', h.GetSamples().Select(s => s.Name)));
|
2020-05-19 14:28:13 +00:00
|
|
|
|
});
|
2020-12-20 17:25:49 +00:00
|
|
|
|
|
|
|
|
|
AddUntilStep("all samples collected", () => actualSampleNames.Count == expectedSampleNames.Length);
|
|
|
|
|
|
2023-06-30 06:38:24 +00:00
|
|
|
|
AddAssert("samples are correct", () => actualSampleNames, () => Is.EqualTo(expectedSampleNames));
|
2020-05-19 14:28:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override IBeatmap CreateBeatmap(RulesetInfo ruleset) => new TaikoBeatmapConversionTest().GetBeatmap("sample-to-type-conversions");
|
|
|
|
|
}
|
|
|
|
|
}
|