mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Fix issues with editor check tests
This commit is contained in:
@ -74,7 +74,7 @@ namespace osu.Game.Tests.Editing.Checks
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestMissingFile()
|
public void TestMissingFile()
|
||||||
{
|
{
|
||||||
beatmap.BeatmapInfo.BeatmapSet.Files.Clear();
|
beatmap.BeatmapInfo.BeatmapSet?.Files.Clear();
|
||||||
|
|
||||||
var issues = check.Run(getContext(null)).ToList();
|
var issues = check.Run(getContext(null)).ToList();
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ namespace osu.Game.Tests.Editing.Checks
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestBackgroundSetAndNotInFiles()
|
public void TestBackgroundSetAndNotInFiles()
|
||||||
{
|
{
|
||||||
beatmap.BeatmapInfo.BeatmapSet.Files.Clear();
|
beatmap.BeatmapInfo.BeatmapSet?.Files.Clear();
|
||||||
|
|
||||||
var context = new BeatmapVerifierContext(beatmap, new TestWorkingBeatmap(beatmap));
|
var context = new BeatmapVerifierContext(beatmap, new TestWorkingBeatmap(beatmap));
|
||||||
var issues = check.Run(context).ToList();
|
var issues = check.Run(context).ToList();
|
||||||
|
@ -1,18 +1,13 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Models;
|
||||||
using osu.Game.IO;
|
|
||||||
|
|
||||||
namespace osu.Game.Tests.Editing.Checks
|
namespace osu.Game.Tests.Editing.Checks
|
||||||
{
|
{
|
||||||
public static class CheckTestHelpers
|
public static class CheckTestHelpers
|
||||||
{
|
{
|
||||||
public static BeatmapSetFileInfo CreateMockFile(string extension) =>
|
public static RealmNamedFileUsage CreateMockFile(string extension) =>
|
||||||
new BeatmapSetFileInfo
|
new RealmNamedFileUsage(new RealmFile { Hash = "abcdef" }, $"abc123.{extension}");
|
||||||
{
|
|
||||||
Filename = $"abc123.{extension}",
|
|
||||||
FileInfo = new FileInfo { Hash = "abcdef" }
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using ManagedBass;
|
using ManagedBass;
|
||||||
@ -45,6 +46,8 @@ namespace osu.Game.Tests.Editing.Checks
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestDifferentExtension()
|
public void TestDifferentExtension()
|
||||||
{
|
{
|
||||||
|
Debug.Assert(beatmap.BeatmapInfo.BeatmapSet != null);
|
||||||
|
|
||||||
beatmap.BeatmapInfo.BeatmapSet.Files.Clear();
|
beatmap.BeatmapInfo.BeatmapSet.Files.Clear();
|
||||||
beatmap.BeatmapInfo.BeatmapSet.Files.Add(CheckTestHelpers.CreateMockFile("jpg"));
|
beatmap.BeatmapInfo.BeatmapSet.Files.Add(CheckTestHelpers.CreateMockFile("jpg"));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user