Skip to content

Commit

Permalink
Merge pull request #2160 from andy840119/updrage-package-to-latest
Browse files Browse the repository at this point in the history
Upgrade package to latest.
  • Loading branch information
andy840119 authored Dec 29, 2023
2 parents a9a178f + d3a7aa9 commit fead14a
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 28 deletions.
17 changes: 14 additions & 3 deletions osu.Game.Rulesets.Karaoke.Tests/Beatmaps/TestElementId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,20 @@ public void TestCompareToOther()
var elementId = new ElementId("1234567");

Assert.AreEqual(elementId.CompareTo(null), 1);
Assert.Throws<ArgumentException>(() => elementId.CompareTo(3)); // should not compare to other type
Assert.Throws<ArgumentException>(() => elementId.CompareTo("123")); // should not compare to the string also.
Assert.DoesNotThrow(() => elementId.CompareTo(new ElementId("1234567")));
Assert.Throws<ArgumentException>(() =>
{
int _ = elementId.CompareTo(3);
});
Assert.Throws<ArgumentException>(() =>
{
// should not compare to other type
int _ = elementId.CompareTo("123");
});
Assert.DoesNotThrow(() =>
{
// should not compare to the string also.
int _ = elementId.CompareTo(new ElementId("1234567"));
});
}

[TestCase("1234567", "1234567", true)]
Expand Down
17 changes: 0 additions & 17 deletions osu.Game.Rulesets.Karaoke.Tests/Mods/KaraokeModPerfectTestScene.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
using NUnit.Framework;
using osu.Game.Rulesets.Karaoke.Mods;
using osu.Game.Rulesets.Karaoke.Objects;
using osu.Game.Tests.Visual;

namespace osu.Game.Rulesets.Karaoke.Tests.Mods;

public partial class TestSceneKaraokeModPerfect : KaraokeModPerfectTestScene
public partial class TestSceneKaraokeModPerfect : ModFailConditionTestScene
{
protected override Ruleset CreatePlayerRuleset() => new KaraokeRuleset();

public TestSceneKaraokeModPerfect()
: base(new KaraokeModPerfect())
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence.
// See the LICENCE file in the repository root for full licence text.

using System.Collections.Generic;
using NUnit.Framework;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Karaoke.Mods;
using osu.Game.Rulesets.Karaoke.Objects;
using osu.Game.Rulesets.Karaoke.Replays;
using osu.Game.Rulesets.Karaoke.Tests.Helper;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Replays;
using osu.Game.Tests.Visual;

namespace osu.Game.Rulesets.Karaoke.Tests.Mods;

[Ignore("Scoring is not implemented.")]
public partial class TestSceneKaraokeModSuddenDeath : ModFailConditionTestScene
{
protected override Ruleset CreatePlayerRuleset() => new KaraokeRuleset();

private readonly Lyric referencedLyric = TestCaseNoteHelper.CreateLyricForNote(1, "カラオケ", 1000, 1000);

public TestSceneKaraokeModSuddenDeath()
: base(new KaraokeModSuddenDeath())
{
}

[Test]
public void TestGreatHit() => CreateModTest(new ModTestData
{
Mod = new KaraokeModSuddenDeath(),
PassCondition = () => ((ModFailConditionTestPlayer)Player).CheckFailed(false),
Autoplay = false,
Beatmap = new Beatmap
{
HitObjects = new List<HitObject>
{
referencedLyric,
new Note
{
ReferenceLyricId = referencedLyric.ID,
Tone = new Tone(0),
},
},
},
ReplayFrames = new List<ReplayFrame>
{
new KaraokeReplayFrame(1000, 0),
new KaraokeReplayFrame(2000, 0),
},
});

[Test]
public void TestBreakOnHoldNote() => CreateModTest(new ModTestData
{
Mod = new KaraokeModSuddenDeath(),
PassCondition = () => ((ModFailConditionTestPlayer)Player).CheckFailed(true) && Player.Results.Count == 2,
Autoplay = false,
Beatmap = new Beatmap
{
HitObjects = new List<HitObject>
{
referencedLyric,
new Note
{
ReferenceLyricId = referencedLyric.ID,
Tone = new Tone(0),
},
},
},
ReplayFrames = new List<ReplayFrame>
{
new KaraokeReplayFrame(0, -1),
},
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ public void CompareWithDifferentLyric()
var caretPosition = createBiggerCaretPosition(lyric1);
var comparedCaretPosition = createSmallerCaretPosition(lyric2);

Assert.Throws<InvalidOperationException>(() => caretPosition.CompareTo(comparedCaretPosition));
Assert.Throws<InvalidOperationException>(() =>
{
int _ = caretPosition.CompareTo(comparedCaretPosition);
});
}

[Test]
Expand All @@ -78,7 +81,10 @@ public void CompareDifferentType()
var caretPosition = createBiggerCaretPosition(lyric);
var comparedCaretPosition = new FakeCaretPosition(lyric);

Assert.Throws<InvalidOperationException>(() => caretPosition.CompareTo(comparedCaretPosition));
Assert.Throws<InvalidOperationException>(() =>
{
int _ = caretPosition.CompareTo(comparedCaretPosition);
});
}

private IIndexCaretPosition createSmallerCaretPosition(Lyric lyric) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public ChangelogHeaderTitle()
{
Title = PageTitleStrings.MainChangelogControllerDefault;
Description = NamedOverlayComponentStrings.ChangelogDescription;
Icon = HexaconsIcons.Devtools;
Icon = OsuIcon.ChangelogB;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public PageScreenTitle()
{
Title = "page";
Description = "create page of your beatmap";
Icon = HexaconsIcons.Social;
Icon = OsuIcon.FeaturedArtistCircle;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public SingerScreenTitle()
{
Title = "singer";
Description = "create singer of your beatmap";
Icon = HexaconsIcons.Social;
Icon = OsuIcon.Player;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public TranslateScreenTitle()
{
Title = "translate";
Description = "create translation of your beatmap";
Icon = HexaconsIcons.Social;
Icon = OsuIcon.Online;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="ppy.osu.Game" Version="2023.1213.0" />
<PackageReference Include="ppy.osu.Game" Version="2023.1229.0" />
<PackageReference Include="Lucene.Net" Version="4.8.0-beta00016" />
<PackageReference Include="Lucene.Net.Analysis.Kuromoji" Version="4.8.0-beta00016" />
<PackageReference Include="SixLabors.Fonts" Version="2.0.1" />
Expand Down

0 comments on commit fead14a

Please sign in to comment.