Address review comments

Now asserting instead of an if-statement, change cast from OsuStorage to MigratableStorage and make internal virtual properties protected.
This commit is contained in:
Shivam
2020-06-24 23:01:56 +02:00
parent 063503f4db
commit 47a732ef60
3 changed files with 16 additions and 17 deletions

View File

@ -126,7 +126,7 @@ namespace osu.Game.Tests.NonVisual
{
var osu = loadOsu(host);
var storage = osu.Dependencies.Get<Storage>();
var osuStorage = storage as OsuStorage;
var osuStorage = storage as MigratableStorage;
// ensure we perform a save
host.Dependencies.Get<FrameworkConfigManager>().Save();
@ -152,19 +152,18 @@ namespace osu.Game.Tests.NonVisual
Assert.That(!host.Storage.ExistsDirectory(Path.Combine("test-nested", "cache")));
Assert.That(storage.ExistsDirectory(Path.Combine("test-nested", "cache")));
if (osuStorage != null)
{
foreach (var file in osuStorage.IgnoreFiles)
{
Assert.That(host.Storage.Exists(file), Is.True);
Assert.That(storage.Exists(file), Is.False);
}
Assert.That(osuStorage, Is.Not.Null);
foreach (var dir in osuStorage.IgnoreDirectories)
{
Assert.That(host.Storage.ExistsDirectory(dir), Is.True);
Assert.That(storage.ExistsDirectory(dir), Is.False);
}
foreach (var file in osuStorage.IgnoreFiles)
{
Assert.That(host.Storage.Exists(file), Is.True);
Assert.That(storage.Exists(file), Is.False);
}
foreach (var dir in osuStorage.IgnoreDirectories)
{
Assert.That(host.Storage.ExistsDirectory(dir), Is.True);
Assert.That(storage.ExistsDirectory(dir), Is.False);
}
Assert.That(new StreamReader(host.Storage.GetStream("storage.ini")).ReadToEnd().Contains($"FullPath = {customPath}"));