public void TestSaveLoad() { var game = new Game(); game.New(); Assert.IsTrue(game.TryStringMove("e2-e4")); Assert.IsTrue(game.TryStringMove("e7-e5")); var gameFile = new GameFile(game); var fileName = @"gamefile.txt"; gameFile.Save(fileName); var loaded = GameFile.Load(fileName); for (int i = 0; i < gameFile.MoveCommands.Count; i++) { Assert.AreEqual(gameFile.MoveCommands[i].ToString(), loaded.MoveCommands[i].ToString()); } }
public void Save(string fileName) { var gameFile = new GameFile(this); gameFile.Save(fileName); }