예제 #1
0
        public void DungeonsTable_LoadTable_Success()
        {
            DungeonsTable dt = DungeonsTable.LoadTable();

            Assert.IsNotNull(dt);
            Assert.IsNotNull(dt.Dungeons);
        }
예제 #2
0
 public void DungeonsTable_LoadTable_MissingFile()
 {
     File.Move(DungeonsTable.FileName, renamedFilename);
     try
     {
         DungeonsTable.LoadTable();
     }
     finally
     {
         File.Move(renamedFilename, DungeonsTable.FileName);
     }
 }
예제 #3
0
        public void DungeonsTable_LoadTable_MissingFile()
        {
            string renamedFilename = "renamedFile.xml";

            File.Move(DungeonsTable.FileName, renamedFilename);

            try
            {
                DungeonsTable dt = DungeonsTable.LoadTable();
            }
            finally
            {
                File.Move(renamedFilename, DungeonsTable.FileName);
            }
        }
예제 #4
0
        public void DungeonsTable_LoadTable_InvalidFile()
        {
            File.Move(DungeonsTable.FileName, renamedFilename);
            File.WriteAllText(DungeonsTable.FileName, "invalid data");

            try
            {
                DungeonsTable.LoadTable();
            }
            finally
            {
                File.Delete(DungeonsTable.FileName);
                File.Move(renamedFilename, DungeonsTable.FileName);
            }
        }