fix failing tests

1) waiting for loading to finish so Drawables are all present to do asserts on
2) fix NullRef in ResultPage because of removed line in DummyWorkingBeatmap (author one)
This commit is contained in:
Aergwyn 2017-12-22 17:38:22 +01:00
parent ed827d5424
commit 6a8fd74e05
2 changed files with 16 additions and 1 deletions

View File

@ -20,6 +20,7 @@ namespace osu.Game.Tests.Visual
{
public class TestCaseBeatmapInfoWedge : OsuTestCase
{
private RulesetStore rulesets;
private TestBeatmapInfoWedge infoWedge;
private readonly List<Beatmap> beatmaps = new List<Beatmap>();
private readonly Bindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
@ -27,7 +28,14 @@ public class TestCaseBeatmapInfoWedge : OsuTestCase
[BackgroundDependencyLoader]
private void load(OsuGameBase game, RulesetStore rulesets)
{
this.rulesets = rulesets;
beatmap.BindTo(game.Beatmap);
}
protected override void LoadComplete()
{
base.LoadComplete();
Add(infoWedge = new TestBeatmapInfoWedge
{

View File

@ -324,7 +324,14 @@ private void load(OsuColour colours, LocalisationEngine localisation)
title.Colour = artist.Colour = colours.BlueDarker;
versionMapper.Colour = colours.Gray8;
versionMapper.Text = $"{beatmap.Version} - mapped by {beatmap.Metadata.Author.Username}";
var creator = beatmap.Metadata.Author?.Username;
if (!string.IsNullOrEmpty(creator)) {
versionMapper.Text = $"mapped by {creator}";
if (!string.IsNullOrEmpty(beatmap.Version))
versionMapper.Text = $"{beatmap.Version} - " + versionMapper.Text;
}
title.Current = localisation.GetUnicodePreference(beatmap.Metadata.TitleUnicode, beatmap.Metadata.Title);
artist.Current = localisation.GetUnicodePreference(beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist);
}