public void DungeonsTable_LoadTable_Success() { DungeonsTable dt = DungeonsTable.LoadTable(); Assert.IsNotNull(dt); Assert.IsNotNull(dt.Dungeons); }
public void DungeonsTable_LoadTable_MissingFile() { File.Move(DungeonsTable.FileName, renamedFilename); try { DungeonsTable.LoadTable(); } finally { File.Move(renamedFilename, DungeonsTable.FileName); } }
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); } }
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); } }