Adjust tests to pass (and add test coverage of fail case)

This commit is contained in:
Bartłomiej Dach
2025-06-27 14:06:30 +02:00
parent c7cd3a9842
commit edafac2aaa
3 changed files with 22 additions and 23 deletions

View File

@@ -14,26 +14,27 @@ namespace osu.Game.Rulesets.Osu.Tests
protected override IResourceStore<byte[]> RulesetResources => new DllResourceStore(Assembly.GetAssembly(typeof(TestSceneOsuHitObjectSamples)));
[TestCase("normal-hitnormal")]
[TestCase("hitnormal")]
public void TestDefaultCustomSampleFromBeatmap(string expectedSample)
[TestCase("normal-hitnormal2", "normal-hitnormal")]
[TestCase("hitnormal", "hitnormal")]
public void TestDefaultCustomSampleFromBeatmap(string beatmapSkinSampleName, string userSkinSampleName)
{
SetupSkins(expectedSample, expectedSample);
SetupSkins(beatmapSkinSampleName, userSkinSampleName);
CreateTestWithBeatmap("osu-hitobject-beatmap-custom-sample-bank.osu");
AssertBeatmapLookup(expectedSample);
AssertBeatmapLookup(beatmapSkinSampleName);
}
[TestCase("normal-hitnormal")]
[TestCase("hitnormal")]
public void TestDefaultCustomSampleFromUserSkinFallback(string expectedSample)
[TestCase("", "normal-hitnormal")]
[TestCase("normal-hitnormal", "normal-hitnormal")]
[TestCase("", "hitnormal")]
public void TestDefaultCustomSampleFromUserSkinFallback(string beatmapSkinSampleName, string userSkinSampleName)
{
SetupSkins(string.Empty, expectedSample);
SetupSkins(beatmapSkinSampleName, userSkinSampleName);
CreateTestWithBeatmap("osu-hitobject-beatmap-custom-sample-bank.osu");
AssertUserLookup(expectedSample);
AssertUserLookup(userSkinSampleName);
}
[TestCase("normal-hitnormal2")]

View File

@@ -14,26 +14,27 @@ namespace osu.Game.Rulesets.Taiko.Tests
protected override IResourceStore<byte[]> RulesetResources => new DllResourceStore(Assembly.GetAssembly(typeof(TestSceneTaikoHitObjectSamples)));
[TestCase("taiko-normal-hitnormal")]
[TestCase("hitnormal")]
public void TestDefaultCustomSampleFromBeatmap(string expectedSample)
[TestCase("taiko-normal-hitnormal2", "taiko-normal-hitnormal")]
[TestCase("hitnormal", "hitnormal")]
public void TestDefaultCustomSampleFromBeatmap(string beatmapSkinSampleName, string userSkinSampleName)
{
SetupSkins(expectedSample, expectedSample);
SetupSkins(beatmapSkinSampleName, userSkinSampleName);
CreateTestWithBeatmap("taiko-hitobject-beatmap-custom-sample-bank.osu");
AssertBeatmapLookup(expectedSample);
AssertBeatmapLookup(beatmapSkinSampleName);
}
[TestCase("taiko-normal-hitnormal")]
[TestCase("hitnormal")]
public void TestDefaultCustomSampleFromUserSkinFallback(string expectedSample)
[TestCase("", "taiko-normal-hitnormal")]
[TestCase("taiko-normal-hitnormal", "taiko-normal-hitnormal")]
[TestCase("", "hitnormal")]
public void TestDefaultCustomSampleFromUserSkinFallback(string beatmapSkinSampleName, string userSkinSampleName)
{
SetupSkins(string.Empty, expectedSample);
SetupSkins(beatmapSkinSampleName, userSkinSampleName);
CreateTestWithBeatmap("taiko-hitobject-beatmap-custom-sample-bank.osu");
AssertUserLookup(expectedSample);
AssertUserLookup(userSkinSampleName);
}
[TestCase("taiko-normal-hitnormal2")]

View File

@@ -64,11 +64,9 @@ namespace osu.Game.Tests.Gameplay
/// <summary>
/// Tests that a hitobject which provides a custom sample set of 2 retrieves the following samples from the beatmap skin:
/// normal-hitnormal2
/// normal-hitnormal
/// hitnormal
/// </summary>
[TestCase("normal-hitnormal2")]
[TestCase("normal-hitnormal")]
[TestCase("hitnormal")]
public void TestDefaultCustomSampleFromBeatmap(string expectedSample)
{
@@ -162,7 +160,6 @@ namespace osu.Game.Tests.Gameplay
/// Tests that a control point that provides a custom sample of 2 causes <see cref="TestDefaultCustomSampleFromBeatmap"/>.
/// </summary>
[TestCase("normal-hitnormal2")]
[TestCase("normal-hitnormal")]
[TestCase("hitnormal")]
public void TestControlPointCustomSampleFromBeatmap(string sampleName)
{