Remove unused property and reuse tournamentBasePath

This commit is contained in:
Shivam 2020-06-11 15:47:21 +02:00
parent 883185d349
commit 603054f521
1 changed files with 2 additions and 4 deletions

View File

@ -33,7 +33,7 @@ public void TestDefaultDirectory()
{ {
var osu = loadOsu(host); var osu = loadOsu(host);
var storage = osu.Dependencies.Get<TournamentStorage>(); var storage = osu.Dependencies.Get<TournamentStorage>();
var defaultStorage = Path.Combine(RuntimeInfo.StartupDirectory, "headless", nameof(TestDefaultDirectory), "tournaments", "default"); var defaultStorage = Path.Combine(tournamentBasePath(nameof(TestDefaultDirectory)), "default");
Assert.That(storage.GetFullPath("."), Is.EqualTo(defaultStorage)); Assert.That(storage.GetFullPath("."), Is.EqualTo(defaultStorage));
} }
finally finally
@ -107,7 +107,7 @@ public void TestMigration()
var storage = osu.Dependencies.Get<TournamentStorage>(); var storage = osu.Dependencies.Get<TournamentStorage>();
var migratedPath = Path.Combine(RuntimeInfo.StartupDirectory, "headless", nameof(TestMigration), "tournaments", "default"); var migratedPath = Path.Combine(tournamentBasePath(nameof(TestMigration)), "default");
videosPath = Path.Combine(migratedPath, "videos"); videosPath = Path.Combine(migratedPath, "videos");
modsPath = Path.Combine(migratedPath, "mods"); modsPath = Path.Combine(migratedPath, "mods");
@ -151,8 +151,6 @@ private static void waitForOrAssert(Func<bool> result, string failureMessage, in
Assert.IsTrue(task.Wait(timeout), failureMessage); Assert.IsTrue(task.Wait(timeout), failureMessage);
} }
private string oldPath => Path.Combine(RuntimeInfo.StartupDirectory, "tournament");
private string tournamentBasePath(string testInstance) => Path.Combine(RuntimeInfo.StartupDirectory, "headless", testInstance, "tournaments"); private string tournamentBasePath(string testInstance) => Path.Combine(RuntimeInfo.StartupDirectory, "headless", testInstance, "tournaments");
} }
} }