mirror of
https://github.com/osukey/osukey.git
synced 2025-07-23 19:30:06 +09:00
Reset db on dispose
This commit is contained in:
@ -12,7 +12,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
class TestCasePlaySongSelect : TestCase
|
class TestCasePlaySongSelect : TestCase
|
||||||
{
|
{
|
||||||
private BeatmapDatabase db;
|
private BeatmapDatabase db, oldDb;
|
||||||
private TestStorage storage;
|
private TestStorage storage;
|
||||||
|
|
||||||
public override string Name => @"Song Select";
|
public override string Name => @"Song Select";
|
||||||
@ -21,7 +21,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
public override void Reset()
|
public override void Reset()
|
||||||
{
|
{
|
||||||
base.Reset();
|
base.Reset();
|
||||||
|
oldDb = Dependencies.Get<BeatmapDatabase>();
|
||||||
if (db == null)
|
if (db == null)
|
||||||
{
|
{
|
||||||
storage = new TestStorage(@"TestCasePlaySongSelect");
|
storage = new TestStorage(@"TestCasePlaySongSelect");
|
||||||
@ -35,10 +35,15 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
|
|
||||||
db.Import(sets);
|
db.Import(sets);
|
||||||
}
|
}
|
||||||
|
|
||||||
Add(new PlaySongSelect());
|
Add(new PlaySongSelect());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool isDisposing)
|
||||||
|
{
|
||||||
|
Dependencies.Cache(oldDb, true);
|
||||||
|
base.Dispose(isDisposing);
|
||||||
|
}
|
||||||
|
|
||||||
private BeatmapSetInfo createTestBeatmapSet(int i)
|
private BeatmapSetInfo createTestBeatmapSet(int i)
|
||||||
{
|
{
|
||||||
return new BeatmapSetInfo
|
return new BeatmapSetInfo
|
||||||
|
Reference in New Issue
Block a user