Skip to content

Commit edafac2

Browse files
committed
Adjust tests to pass (and add test coverage of fail case)
1 parent c7cd3a9 commit edafac2

File tree

3 files changed

+22
-23
lines changed

3 files changed

+22
-23
lines changed

osu.Game.Rulesets.Osu.Tests/TestSceneOsuHitObjectSamples.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,27 @@ public partial class TestSceneOsuHitObjectSamples : HitObjectSampleTest
1414

1515
protected override IResourceStore<byte[]> RulesetResources => new DllResourceStore(Assembly.GetAssembly(typeof(TestSceneOsuHitObjectSamples)));
1616

17-
[TestCase("normal-hitnormal")]
18-
[TestCase("hitnormal")]
19-
public void TestDefaultCustomSampleFromBeatmap(string expectedSample)
17+
[TestCase("normal-hitnormal2", "normal-hitnormal")]
18+
[TestCase("hitnormal", "hitnormal")]
19+
public void TestDefaultCustomSampleFromBeatmap(string beatmapSkinSampleName, string userSkinSampleName)
2020
{
21-
SetupSkins(expectedSample, expectedSample);
21+
SetupSkins(beatmapSkinSampleName, userSkinSampleName);
2222

2323
CreateTestWithBeatmap("osu-hitobject-beatmap-custom-sample-bank.osu");
2424

25-
AssertBeatmapLookup(expectedSample);
25+
AssertBeatmapLookup(beatmapSkinSampleName);
2626
}
2727

28-
[TestCase("normal-hitnormal")]
29-
[TestCase("hitnormal")]
30-
public void TestDefaultCustomSampleFromUserSkinFallback(string expectedSample)
28+
[TestCase("", "normal-hitnormal")]
29+
[TestCase("normal-hitnormal", "normal-hitnormal")]
30+
[TestCase("", "hitnormal")]
31+
public void TestDefaultCustomSampleFromUserSkinFallback(string beatmapSkinSampleName, string userSkinSampleName)
3132
{
32-
SetupSkins(string.Empty, expectedSample);
33+
SetupSkins(beatmapSkinSampleName, userSkinSampleName);
3334

3435
CreateTestWithBeatmap("osu-hitobject-beatmap-custom-sample-bank.osu");
3536

36-
AssertUserLookup(expectedSample);
37+
AssertUserLookup(userSkinSampleName);
3738
}
3839

3940
[TestCase("normal-hitnormal2")]

osu.Game.Rulesets.Taiko.Tests/TestSceneTaikoHitObjectSamples.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,27 @@ public partial class TestSceneTaikoHitObjectSamples : HitObjectSampleTest
1414

1515
protected override IResourceStore<byte[]> RulesetResources => new DllResourceStore(Assembly.GetAssembly(typeof(TestSceneTaikoHitObjectSamples)));
1616

17-
[TestCase("taiko-normal-hitnormal")]
18-
[TestCase("hitnormal")]
19-
public void TestDefaultCustomSampleFromBeatmap(string expectedSample)
17+
[TestCase("taiko-normal-hitnormal2", "taiko-normal-hitnormal")]
18+
[TestCase("hitnormal", "hitnormal")]
19+
public void TestDefaultCustomSampleFromBeatmap(string beatmapSkinSampleName, string userSkinSampleName)
2020
{
21-
SetupSkins(expectedSample, expectedSample);
21+
SetupSkins(beatmapSkinSampleName, userSkinSampleName);
2222

2323
CreateTestWithBeatmap("taiko-hitobject-beatmap-custom-sample-bank.osu");
2424

25-
AssertBeatmapLookup(expectedSample);
25+
AssertBeatmapLookup(beatmapSkinSampleName);
2626
}
2727

28-
[TestCase("taiko-normal-hitnormal")]
29-
[TestCase("hitnormal")]
30-
public void TestDefaultCustomSampleFromUserSkinFallback(string expectedSample)
28+
[TestCase("", "taiko-normal-hitnormal")]
29+
[TestCase("taiko-normal-hitnormal", "taiko-normal-hitnormal")]
30+
[TestCase("", "hitnormal")]
31+
public void TestDefaultCustomSampleFromUserSkinFallback(string beatmapSkinSampleName, string userSkinSampleName)
3132
{
32-
SetupSkins(string.Empty, expectedSample);
33+
SetupSkins(beatmapSkinSampleName, userSkinSampleName);
3334

3435
CreateTestWithBeatmap("taiko-hitobject-beatmap-custom-sample-bank.osu");
3536

36-
AssertUserLookup(expectedSample);
37+
AssertUserLookup(userSkinSampleName);
3738
}
3839

3940
[TestCase("taiko-normal-hitnormal2")]

osu.Game.Tests/Gameplay/TestSceneHitObjectSamples.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,9 @@ public void TestDefaultSampleFromUserSkinFallback()
6464
/// <summary>
6565
/// Tests that a hitobject which provides a custom sample set of 2 retrieves the following samples from the beatmap skin:
6666
/// normal-hitnormal2
67-
/// normal-hitnormal
6867
/// hitnormal
6968
/// </summary>
7069
[TestCase("normal-hitnormal2")]
71-
[TestCase("normal-hitnormal")]
7270
[TestCase("hitnormal")]
7371
public void TestDefaultCustomSampleFromBeatmap(string expectedSample)
7472
{
@@ -162,7 +160,6 @@ public void TestControlPointSampleFromBeatmap()
162160
/// Tests that a control point that provides a custom sample of 2 causes <see cref="TestDefaultCustomSampleFromBeatmap"/>.
163161
/// </summary>
164162
[TestCase("normal-hitnormal2")]
165-
[TestCase("normal-hitnormal")]
166163
[TestCase("hitnormal")]
167164
public void TestControlPointCustomSampleFromBeatmap(string sampleName)
168165
{

0 commit comments

Comments
 (0)