From 356f5dceef8e898dc592b8630b82b1bfda3eecfa Mon Sep 17 00:00:00 2001 From: PercyDan54 <50285552+PercyDan54@users.noreply.github.com> Date: Sun, 4 Jul 2021 22:31:08 +0800 Subject: [PATCH] Add more test case --- .../BeatmapMetadataRomanisationTest.cs | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/osu.Game.Tests/Localisation/BeatmapMetadataRomanisationTest.cs b/osu.Game.Tests/Localisation/BeatmapMetadataRomanisationTest.cs index 582864079d..dab4825919 100644 --- a/osu.Game.Tests/Localisation/BeatmapMetadataRomanisationTest.cs +++ b/osu.Game.Tests/Localisation/BeatmapMetadataRomanisationTest.cs @@ -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); }