示例#1
0
文件: GamesTests.cs 项目: MSIH/ELO
        public void CanPersistAndRetrieveAGame()
        {
            var game = new Game {Winner = "A", Loser = "B"};

            var gameString = game.Serialize();
            var recreatedGame = Game.Deserialize(gameString);

            Assert.AreEqual(game, recreatedGame);
        }
示例#2
0
文件: GamesData.cs 项目: MSIH/ELO
 public static void PersistGame(Game game)
 {
     File.AppendAllText(_path, game.Serialize() + "\n");
 }