diff --git a/osu.Game.Tests/Editing/Checks/CheckHitsoundsFormatTest.cs b/osu.Game.Tests/Editing/Checks/CheckHitsoundsFormatTest.cs index cb1cf21734..6da391aa8d 100644 --- a/osu.Game.Tests/Editing/Checks/CheckHitsoundsFormatTest.cs +++ b/osu.Game.Tests/Editing/Checks/CheckHitsoundsFormatTest.cs @@ -117,6 +117,52 @@ namespace osu.Game.Tests.Editing.Checks } } + [Test] + public void TestBeatmapAudioTracksExemptedFromCheck() + { + using (var resourceStream = TestResources.OpenResource("Samples/corrupt.wav")) + { + var beatmapSet = new BeatmapSetInfo + { + Files = + { + CheckTestHelpers.CreateMockFile("wav"), + CheckTestHelpers.CreateMockFile("mp3") + } + }; + + var firstPlayable = new Beatmap + { + BeatmapInfo = new BeatmapInfo + { + BeatmapSet = beatmapSet, + Metadata = new BeatmapMetadata { AudioFile = beatmapSet.Files[0].Filename } + } + }; + var firstWorking = new Mock(firstPlayable, null, null); + firstWorking.Setup(w => w.GetStream(It.IsAny())).Returns(resourceStream); + + var secondPlayable = new Beatmap + { + BeatmapInfo = new BeatmapInfo + { + BeatmapSet = beatmapSet, + Metadata = new BeatmapMetadata { AudioFile = beatmapSet.Files[1].Filename } + } + }; + var secondWorking = new Mock(secondPlayable, null, null); + secondWorking.Setup(w => w.GetStream(It.IsAny())).Returns(resourceStream); + + var context = new BeatmapVerifierContext( + new BeatmapVerifierContext.VerifiedBeatmap(firstWorking.Object, firstPlayable), + [new BeatmapVerifierContext.VerifiedBeatmap(secondWorking.Object, secondPlayable)], + DifficultyRating.ExpertPlus); + + var issues = check.Run(context).ToList(); + Assert.That(issues, Is.Empty); + } + } + private BeatmapVerifierContext getContext(Stream? resourceStream) { var mockWorkingBeatmap = new Mock(beatmap, null, null);