mirror of
https://github.com/ppy/osu.git
synced 2026-05-13 19:54:15 +08:00
a996261304
It's been a while. Notes: - `SharpCompress` usages changed a bit. Manually adjusted these, mostly just renames or adjusted parameters. - nUnit 3 -> 4 migrated using https://gist.github.com/peppy/07994386d793a117350cb5f24b156585. there's a mode in this script to update to the newer `Assert.That` syntax but it requires fixes and couldn't really be bothered. - DeepEqual nuked as the only usage was on a disabled test. The reason it's disabled has been merged upstream, but it's failing for other (realm) reasons which I don't think is worthwhile to investigate for now. - This bumps Moq. I think the author is back in a sensible headspace and the new version has the stupid shit removed, so probably okay? Nice to be on a level playing field with packages for once in a long time. - Automapper is silly, but we've discussed this elsewhere. - `TestRealmKeyBindingStore` failures are a wildcard, but fixed by using a more standardised testing method. Dunno why, don't care. --------- Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
// 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.
|
|
|
|
using NUnit.Framework;
|
|
using NUnit.Framework.Legacy;
|
|
using osu.Game.Beatmaps;
|
|
|
|
namespace osu.Game.Tests.Localisation
|
|
{
|
|
[TestFixture]
|
|
public class BeatmapMetadataRomanisationTest
|
|
{
|
|
[Test]
|
|
public void TestRomanisation()
|
|
{
|
|
var metadata = new BeatmapMetadata
|
|
{
|
|
Artist = "Romanised Artist",
|
|
ArtistUnicode = "Unicode Artist",
|
|
Title = "Romanised title",
|
|
TitleUnicode = "Unicode Title"
|
|
};
|
|
var romanisableString = metadata.GetDisplayTitleRomanisable();
|
|
|
|
ClassicAssert.AreEqual(metadata.ToString(), romanisableString.Romanised);
|
|
ClassicAssert.AreEqual($"{metadata.ArtistUnicode} - {metadata.TitleUnicode}", romanisableString.Original);
|
|
}
|
|
|
|
[Test]
|
|
public void TestRomanisationNoUnicode()
|
|
{
|
|
var metadata = new BeatmapMetadata
|
|
{
|
|
Artist = "Romanised Artist",
|
|
Title = "Romanised title"
|
|
};
|
|
var romanisableString = metadata.GetDisplayTitleRomanisable();
|
|
|
|
ClassicAssert.AreEqual(romanisableString.Romanised, romanisableString.Original);
|
|
}
|
|
}
|
|
}
|