mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Introduce TestStorage
This commit is contained in:
29
osu.Desktop.VisualTests/Platform/TestStorage.cs
Normal file
29
osu.Desktop.VisualTests/Platform/TestStorage.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Desktop.Platform;
|
||||
using SQLite.Net;
|
||||
using SQLite.Net.Platform.Generic;
|
||||
using SQLite.Net.Interop;
|
||||
using SQLite.Net.Platform.Win32;
|
||||
|
||||
namespace osu.Desktop.Platform
|
||||
{
|
||||
public class TestStorage : DesktopStorage
|
||||
{
|
||||
public TestStorage(string baseName) : base(baseName)
|
||||
{
|
||||
}
|
||||
|
||||
public override SQLiteConnection GetDatabase(string name)
|
||||
{
|
||||
Directory.CreateDirectory(BasePath);
|
||||
ISQLitePlatform platform;
|
||||
if (RuntimeInfo.IsWindows)
|
||||
platform = new SQLitePlatformWin32();
|
||||
else
|
||||
platform = new SQLitePlatformGeneric();
|
||||
return new SQLiteConnection(platform, $@":memory:");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user