2020-04-22 08:19:34 +08:00
|
|
|
// 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.
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
#nullable disable
|
|
|
|
|
2020-04-22 08:19:34 +08:00
|
|
|
using NUnit.Framework;
|
|
|
|
using osu.Game.Beatmaps;
|
2021-11-22 14:52:55 +08:00
|
|
|
using osu.Game.Models;
|
2020-04-22 08:19:34 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Tests.Beatmaps
|
|
|
|
{
|
|
|
|
[TestFixture]
|
|
|
|
public class ToStringFormattingTest
|
|
|
|
{
|
|
|
|
[Test]
|
|
|
|
public void TestArtistTitle()
|
|
|
|
{
|
|
|
|
var beatmap = new BeatmapInfo
|
|
|
|
{
|
|
|
|
Metadata = new BeatmapMetadata
|
|
|
|
{
|
|
|
|
Artist = "artist",
|
|
|
|
Title = "title"
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
Assert.That(beatmap.ToString(), Is.EqualTo("artist - title"));
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void TestArtistTitleCreator()
|
|
|
|
{
|
|
|
|
var beatmap = new BeatmapInfo
|
|
|
|
{
|
|
|
|
Metadata = new BeatmapMetadata
|
|
|
|
{
|
|
|
|
Artist = "artist",
|
|
|
|
Title = "title",
|
2021-11-22 14:52:55 +08:00
|
|
|
Author = new RealmUser { Username = "creator" }
|
2020-04-22 08:19:34 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
Assert.That(beatmap.ToString(), Is.EqualTo("artist - title (creator)"));
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void TestArtistTitleCreatorDifficulty()
|
|
|
|
{
|
|
|
|
var beatmap = new BeatmapInfo
|
|
|
|
{
|
|
|
|
Metadata = new BeatmapMetadata
|
|
|
|
{
|
|
|
|
Artist = "artist",
|
|
|
|
Title = "title",
|
2021-11-22 14:52:55 +08:00
|
|
|
Author = new RealmUser { Username = "creator" }
|
2020-04-22 08:19:34 +08:00
|
|
|
},
|
2021-11-11 16:19:53 +08:00
|
|
|
DifficultyName = "difficulty"
|
2020-04-22 08:19:34 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
Assert.That(beatmap.ToString(), Is.EqualTo("artist - title (creator) [difficulty]"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|