2020-04-22 00:19:34 +00: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.
|
|
|
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
using osu.Game.Beatmaps;
|
2021-11-22 06:52:55 +00:00
|
|
|
using osu.Game.Models;
|
2020-04-22 00:19:34 +00: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 06:52:55 +00:00
|
|
|
Author = new RealmUser { Username = "creator" }
|
2020-04-22 00:19:34 +00: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 06:52:55 +00:00
|
|
|
Author = new RealmUser { Username = "creator" }
|
2020-04-22 00:19:34 +00:00
|
|
|
},
|
2021-11-11 08:19:53 +00:00
|
|
|
DifficultyName = "difficulty"
|
2020-04-22 00:19:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Assert.That(beatmap.ToString(), Is.EqualTo("artist - title (creator) [difficulty]"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|