private static void runHost(StorageLookupHeadlessGameHost host) { TestGame game = new TestGame(); game.Schedule(() => game.Exit()); host.Run(game); }
public void TestSecondDataExisting() { Directory.CreateDirectory(Path.Combine(path2, game_name)); using (var host = new StorageLookupHeadlessGameHost()) { runHost(host); Assert.IsTrue(host.Storage.GetFullPath(string.Empty).StartsWith(path2, StringComparison.Ordinal)); } }
public void TestSecondBaseExistingStillPrefersFirst() { Directory.CreateDirectory(path2); using (var host = new StorageLookupHeadlessGameHost()) { runHost(host); Assert.IsTrue(host.Storage.GetFullPath(string.Empty).StartsWith(path1, StringComparison.Ordinal)); } }
public void TestSecondBaseUsedIfFirstFails() { // write a file so directory creation fails. File.WriteAllText(path1, ""); using (var host = new StorageLookupHeadlessGameHost()) { runHost(host); Assert.IsTrue(host.Storage.GetFullPath(string.Empty).StartsWith(path2, StringComparison.Ordinal)); } }