1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 08:33:21 +08:00

Add more test case

This commit is contained in:
PercyDan54 2021-07-04 22:31:08 +08:00
parent 44d540eb53
commit 356f5dceef
No known key found for this signature in database
GPG Key ID: 6AEA7C525131BAF3

View File

@ -10,20 +10,30 @@ namespace osu.Game.Tests.Localisation
public class BeatmapMetadataRomanisationTest
{
[Test]
public void TestNoUnicode()
public void TestRomanisation()
{
var beatmap = new Beatmap
var metadata = new BeatmapMetadata
{
BeatmapInfo = new BeatmapInfo
{
Metadata = new BeatmapMetadata
{
Artist = "Artist",
Title = "Romanised title"
}
}
Artist = "Romanised Artist",
ArtistUnicode = "Unicode Artist",
Title = "Romanised title",
TitleUnicode = "Unicode Title"
};
var romanisableString = beatmap.Metadata.ToRomanisableString();
var romanisableString = metadata.ToRomanisableString();
Assert.AreEqual(metadata.ToString(), romanisableString.Romanised);
Assert.AreEqual($"{metadata.ArtistUnicode} - {metadata.TitleUnicode}", romanisableString.Original);
}
[Test]
public void TestRomanisationNoUnicode()
{
var metadata = new BeatmapMetadata
{
Artist = "Romanised Artist",
Title = "Romanised title"
};
var romanisableString = metadata.ToRomanisableString();
Assert.AreEqual(romanisableString.Romanised, romanisableString.Original);
}