mirror of
https://github.com/osukey/osukey.git
synced 2025-06-26 13:47:58 +09:00
Adjust skin resources test to facilitate loading many
This commit is contained in:
parent
d38316bf4f
commit
a126c72a4f
@ -31,17 +31,14 @@ namespace osu.Game.Tests.Skins
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private SkinManager skins { get; set; } = null!;
|
private SkinManager skins { get; set; } = null!;
|
||||||
|
|
||||||
private ISkin skin = null!;
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load()
|
|
||||||
{
|
|
||||||
var imported = skins.Import(new ImportTask(TestResources.OpenResource("Archives/ogg-skin.osk"), "ogg-skin.osk")).GetResultSafely();
|
|
||||||
skin = imported.PerformRead(skinInfo => skins.GetSkin(skinInfo));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestRetrieveOggSample() => AddAssert("sample is non-null", () => skin.GetSample(new SampleInfo("sample")) != null);
|
public void TestRetrieveOggSample()
|
||||||
|
{
|
||||||
|
ISkin skin = null!;
|
||||||
|
|
||||||
|
AddStep("import skin", () => skin = importSkinFromArchives(@"ogg-skin.osk"));
|
||||||
|
AddAssert("sample is non-null", () => skin.GetSample(new SampleInfo(@"sample")) != null);
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestSampleRetrievalOrder()
|
public void TestSampleRetrievalOrder()
|
||||||
@ -78,6 +75,12 @@ namespace osu.Game.Tests.Skins
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Skin importSkinFromArchives(string filename)
|
||||||
|
{
|
||||||
|
var imported = skins.Import(new ImportTask(TestResources.OpenResource($@"Archives/{filename}"), filename)).GetResultSafely();
|
||||||
|
return imported.PerformRead(skinInfo => skins.GetSkin(skinInfo));
|
||||||
|
}
|
||||||
|
|
||||||
private class TestSkin : Skin
|
private class TestSkin : Skin
|
||||||
{
|
{
|
||||||
public const string SAMPLE_NAME = "test-sample";
|
public const string SAMPLE_NAME = "test-sample";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user