1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

Add test coverage of layout retrievable after importing modified skins

This commit is contained in:
Dean Herbert 2023-11-15 14:08:05 +09:00
parent a5e1dd8107
commit aac1854d83
No known key found for this signature in database

View File

@ -9,10 +9,12 @@ using System.Threading.Tasks;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Platform;
using osu.Framework.Testing;
using osu.Game.Database;
using osu.Game.Extensions;
using osu.Game.IO;
using osu.Game.Skinning;
using osu.Game.Tests.Resources;
using SharpCompress.Archives.Zip;
namespace osu.Game.Tests.Skins.IO
@ -21,6 +23,25 @@ namespace osu.Game.Tests.Skins.IO
{
#region Testing filename metadata inclusion
[TestCase("Archives/modified-classic-20220723.osk")]
[TestCase("Archives/modified-default-20230117.osk")]
[TestCase("Archives/modified-argon-20231106.osk")]
public Task TestImportModifiedSkinHasResources(string archive) => runSkinTest(async osu =>
{
using (var stream = TestResources.OpenResource(archive))
{
var imported = await loadSkinIntoOsu(osu, new ImportTask(stream, "skin.osk"));
// When the import filename doesn't match, it should be appended (and update the skin.ini).
var skinManager = osu.Dependencies.Get<SkinManager>();
skinManager.CurrentSkinInfo.Value = imported;
Assert.That(skinManager.CurrentSkin.Value.LayoutInfos.Count, Is.EqualTo(2));
}
});
[Test]
public Task TestSingleImportDifferentFilename() => runSkinTest(async osu =>
{