Add test coverage

This commit is contained in:
Dean Herbert
2020-05-14 19:05:35 +09:00
parent 4e4a779d68
commit a582611647
3 changed files with 46 additions and 6 deletions

View File

@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
{
private readonly DirectoryInfo destination;
[Resolved]
[Resolved(canBeNull: true)]
private OsuGame game { get; set; }
public override bool AllowBackButton => false;
@ -84,7 +84,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
Beatmap.Value = Beatmap.Default;
migrationTask = Task.Run(() => game.Migrate(destination.FullName))
migrationTask = Task.Run(PerformMigration)
.ContinueWith(t =>
{
if (t.IsFaulted)
@ -94,6 +94,8 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
});
}
protected virtual void PerformMigration() => game?.Migrate(destination.FullName);
public override void OnEntering(IScreen last)
{
base.OnEntering(last);