2020-02-18 12:21:55 +08: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.
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
#nullable disable
|
|
|
|
|
2020-02-18 12:21:55 +08:00
|
|
|
using NUnit.Framework;
|
|
|
|
using osu.Framework.Allocation;
|
2022-01-03 16:31:12 +08:00
|
|
|
using osu.Framework.Extensions;
|
2020-02-18 12:21:55 +08:00
|
|
|
using osu.Framework.Testing;
|
|
|
|
using osu.Game.Audio;
|
|
|
|
using osu.Game.IO.Archives;
|
|
|
|
using osu.Game.Skinning;
|
|
|
|
using osu.Game.Tests.Resources;
|
|
|
|
using osu.Game.Tests.Visual;
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Skins
|
|
|
|
{
|
|
|
|
[HeadlessTest]
|
|
|
|
public class TestSceneSkinResources : OsuTestScene
|
|
|
|
{
|
|
|
|
[Resolved]
|
|
|
|
private SkinManager skins { get; set; }
|
|
|
|
|
|
|
|
private ISkin skin;
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
2022-01-06 21:54:43 +08:00
|
|
|
var imported = skins.Import(new ZipArchiveReader(TestResources.OpenResource("Archives/ogg-skin.osk"))).GetResultSafely();
|
2021-11-29 16:57:17 +08:00
|
|
|
skin = imported.PerformRead(skinInfo => skins.GetSkin(skinInfo));
|
2020-02-18 12:21:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void TestRetrieveOggSample() => AddAssert("sample is non-null", () => skin.GetSample(new SampleInfo("sample")) != null);
|
|
|
|
}
|
|
|
|
}
|