Fix potential nullref in test

This commit is contained in:
smoogipoo 2020-06-11 13:41:53 +09:00
parent 969d0b7228
commit 702bd2b65d

View File

@ -38,13 +38,9 @@ namespace osu.Game.Tests.Visual.SongSelect
public class TestScenePlaySongSelect : ScreenTestScene public class TestScenePlaySongSelect : ScreenTestScene
{ {
private BeatmapManager manager; private BeatmapManager manager;
private RulesetStore rulesets; private RulesetStore rulesets;
private MusicController music; private MusicController music;
private WorkingBeatmap defaultBeatmap; private WorkingBeatmap defaultBeatmap;
private TestSongSelect songSelect; private TestSongSelect songSelect;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
@ -308,15 +304,13 @@ namespace osu.Game.Tests.Visual.SongSelect
AddAssert("random map selected", () => songSelect.CurrentBeatmap != defaultBeatmap); AddAssert("random map selected", () => songSelect.CurrentBeatmap != defaultBeatmap);
var sortMode = config.GetBindable<SortMode>(OsuSetting.SongSelectSortingMode); AddStep(@"Sort by Artist", () => config.Set(OsuSetting.SongSelectSortingMode, SortMode.Artist));
AddStep(@"Sort by Title", () => config.Set(OsuSetting.SongSelectSortingMode, SortMode.Title));
AddStep(@"Sort by Artist", delegate { sortMode.Value = SortMode.Artist; }); AddStep(@"Sort by Author", () => config.Set(OsuSetting.SongSelectSortingMode, SortMode.Author));
AddStep(@"Sort by Title", delegate { sortMode.Value = SortMode.Title; }); AddStep(@"Sort by DateAdded", () => config.Set(OsuSetting.SongSelectSortingMode, SortMode.DateAdded));
AddStep(@"Sort by Author", delegate { sortMode.Value = SortMode.Author; }); AddStep(@"Sort by BPM", () => config.Set(OsuSetting.SongSelectSortingMode, SortMode.BPM));
AddStep(@"Sort by DateAdded", delegate { sortMode.Value = SortMode.DateAdded; }); AddStep(@"Sort by Length", () => config.Set(OsuSetting.SongSelectSortingMode, SortMode.Length));
AddStep(@"Sort by BPM", delegate { sortMode.Value = SortMode.BPM; }); AddStep(@"Sort by Difficulty", () => config.Set(OsuSetting.SongSelectSortingMode, SortMode.Difficulty));
AddStep(@"Sort by Length", delegate { sortMode.Value = SortMode.Length; });
AddStep(@"Sort by Difficulty", delegate { sortMode.Value = SortMode.Difficulty; });
} }
[Test] [Test]