Example #1
0
        public void ShoulRollbackPlayerSnap()
        {
            //set Player to level 1 stage
            player.Level     = 1;
            player.Score     = 10;
            player.Timestamp = DateTime.Now;
            var snap = player.CreatePlayerSnap();

            playerHistory.AddPlayerSnap(snap);

            //set Player to level 2 stage
            player.Level     = 2;
            player.Score     = 20;
            player.Timestamp = DateTime.Now;

            //rollback player to previous level
            player.RestorePlayerSnap(playerHistory.GetPlayerSnap());
            Assert.AreEqual(player.Level, 1);
            Assert.AreEqual(player.Score, 10);
        }