Move StoragePath implementation to an extension method

This commit is contained in:
Dean Herbert
2021-11-19 16:07:55 +09:00
parent c6c6b04f2b
commit 59e763467f
23 changed files with 58 additions and 37 deletions

View File

@ -6,6 +6,7 @@ using System.IO;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Logging;
using osu.Game.Extensions;
using osu.Game.Models;
using osu.Game.Stores;
@ -28,7 +29,7 @@ namespace osu.Game.Tests.Database
realm.Write(() => files.Add(testData, realm));
Assert.True(files.Storage.Exists("0/05/054edec1d0211f624fed0cbca9d4f9400b0e491c43742af2c5b0abebf0c990d8"));
Assert.True(files.Storage.Exists(realm.All<RealmFile>().First().StoragePath));
Assert.True(files.Storage.Exists(realm.All<RealmFile>().First().GetStoragePath()));
});
}
@ -74,7 +75,7 @@ namespace osu.Game.Tests.Database
Logger.Log($"Import complete at {timer.ElapsedMilliseconds}");
string path = file.StoragePath;
string path = file.GetStoragePath();
Assert.True(realm.All<RealmFile>().Any());
Assert.True(files.Storage.Exists(path));
@ -98,7 +99,7 @@ namespace osu.Game.Tests.Database
var file = realm.Write(() => files.Add(new MemoryStream(new byte[] { 0, 1, 2, 3 }), realm));
string path = file.StoragePath;
string path = file.GetStoragePath();
Assert.True(realm.All<RealmFile>().Any());
Assert.True(files.Storage.Exists(path));