From 1fad2a8f2cf632dbd71dfb2e9e5a93e3e41e9095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 17 Apr 2025 10:05:57 +0200 Subject: [PATCH] Add failing test --- osu.Game.Tests/Scores/IO/ImportScoreTest.cs | 29 +++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/osu.Game.Tests/Scores/IO/ImportScoreTest.cs b/osu.Game.Tests/Scores/IO/ImportScoreTest.cs index 9c72804a6b..6558834a63 100644 --- a/osu.Game.Tests/Scores/IO/ImportScoreTest.cs +++ b/osu.Game.Tests/Scores/IO/ImportScoreTest.cs @@ -215,6 +215,35 @@ namespace osu.Game.Tests.Scores.IO } } + [Test] + public void TestScoreWithInvalidModCombinationsWillNotImport() + { + using (HeadlessGameHost host = new CleanRunHeadlessGameHost()) + { + try + { + var osu = LoadOsuIntoHost(host, true); + + var beatmap = BeatmapImportHelper.LoadOszIntoOsu(osu, TestResources.GetQuickTestBeatmapForImport()).GetResultSafely(); + + var toImport = new ScoreInfo + { + User = new APIUser { Username = "Test user" }, + BeatmapInfo = beatmap.Beatmaps.First(), + Ruleset = new OsuRuleset().RulesetInfo, + ClientVersion = "12345", + Mods = new Mod[] { new OsuModHalfTime(), new OsuModDoubleTime() }, + }; + + Assert.Throws(() => LoadScoreIntoOsu(osu, toImport)); + } + finally + { + host.Exit(); + } + } + } + [Test] public void TestImportStatistics() {