예제 #1
0
        private static void runHost(StorageLookupHeadlessGameHost host)
        {
            TestGame game = new TestGame();

            game.Schedule(() => game.Exit());
            host.Run(game);
        }
예제 #2
0
        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));
            }
        }
예제 #3
0
        public void TestSecondBaseExistingStillPrefersFirst()
        {
            Directory.CreateDirectory(path2);

            using (var host = new StorageLookupHeadlessGameHost())
            {
                runHost(host);
                Assert.IsTrue(host.Storage.GetFullPath(string.Empty).StartsWith(path1, StringComparison.Ordinal));
            }
        }
예제 #4
0
        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));
            }
        }