1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 07:42:57 +08:00

Decouple abstract sample test from TestResources

This commit is contained in:
Bartłomiej Dach 2020-06-21 18:19:33 +02:00
parent 599543acb6
commit 4a8a673d41
2 changed files with 6 additions and 2 deletions

View File

@ -16,7 +16,6 @@ using osu.Game.IO;
using osu.Game.Rulesets;
using osu.Game.Skinning;
using osu.Game.Storyboards;
using osu.Game.Tests.Resources;
using osu.Game.Tests.Visual;
using osu.Game.Users;
@ -24,6 +23,8 @@ namespace osu.Game.Tests.Gameplay
{
public abstract class HitObjectSampleTest : PlayerTestScene
{
protected abstract IResourceStore<byte[]> Resources { get; }
private readonly SkinInfo userSkinInfo = new SkinInfo();
private readonly BeatmapInfo beatmapInfo = new BeatmapInfo
@ -61,7 +62,7 @@ namespace osu.Game.Tests.Gameplay
AddStep($"load {filename}", () =>
{
using (var reader = new LineBufferedReader(TestResources.OpenResource($"SampleLookups/{filename}")))
using (var reader = new LineBufferedReader(Resources.GetStream($"Resources/SampleLookups/{filename}")))
currentTestBeatmap = Decoder.GetDecoder<Beatmap>(reader).Decode(reader);
});
});

View File

@ -2,9 +2,11 @@
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using osu.Framework.IO.Stores;
using osu.Framework.Testing;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Osu;
using osu.Game.Tests.Resources;
namespace osu.Game.Tests.Gameplay
{
@ -12,6 +14,7 @@ namespace osu.Game.Tests.Gameplay
public class TestSceneHitObjectSamples : HitObjectSampleTest
{
protected override Ruleset CreatePlayerRuleset() => new OsuRuleset();
protected override IResourceStore<byte[]> Resources => TestResources.GetStore();
/// <summary>
/// Tests that a hitobject which provides no custom sample set retrieves samples from the user skin.