Merge pull request #189 from SirCmpwn/general-fixes

General fixes
This commit is contained in:
Dean Herbert
2016-11-26 16:56:07 +09:00
committed by GitHub
7 changed files with 59 additions and 52 deletions

View File

@ -1,31 +1,32 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
using osu.Desktop.VisualTests.Platform;
using osu.Framework.GameModes.Testing;
using osu.Game.Database;
using osu.Game.Modes;
using osu.Game.Screens.Select;
namespace osu.Desktop.VisualTests.Tests
{
class TestCasePlaySongSelect : TestCase
{
private BeatmapDatabase db;
private TestStorage storage;
public override string Name => @"Song Select";
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
using osu.Desktop.VisualTests.Platform;
using osu.Framework.GameModes.Testing;
using osu.Game.Database;
using osu.Game.Modes;
using osu.Game.Screens.Select;
namespace osu.Desktop.VisualTests.Tests
{
class TestCasePlaySongSelect : TestCase
{
private BeatmapDatabase db, oldDb;
private TestStorage storage;
public override string Name => @"Song Select";
public override string Description => @"with fake data";
public override void Reset()
{
public override void Reset()
{
base.Reset();
oldDb = Dependencies.Get<BeatmapDatabase>();
if (db == null)
{
storage = new TestStorage(@"TestCasePlaySongSelect");
db = new BeatmapDatabase(storage);
Dependencies.Cache(db, true);
var sets = new List<BeatmapSetInfo>();
@ -34,8 +35,13 @@ namespace osu.Desktop.VisualTests.Tests
db.Import(sets);
}
Add(new PlaySongSelect(db));
Add(new PlaySongSelect());
}
protected override void Dispose(bool isDisposing)
{
Dependencies.Cache(oldDb, true);
base.Dispose(isDisposing);
}
private BeatmapSetInfo createTestBeatmapSet(int i)
@ -89,6 +95,6 @@ namespace osu.Desktop.VisualTests.Tests
},
}),
};
}
}
}
}
}
}