Пример #1
0
        public void GameStateIsSameAsBefore()
        {
            Game withItems = new Game(5, 2, 20, false);

            withItems.dungeon.player.PickUp(new HealingPotion("0"));
            withItems.dungeon.player.PickUp(new HealingPotion("1"));
            withItems.dungeon.player.PickUp(new HealingPotion("2"));
            withItems.dungeon.player.PickUp(new HealingPotion("3"));
            withItems.dungeon.turn = 5;
            Gamestate withItemsGS = new Gamestate(withItems);
            Savegame  save        = new Savegame(withItemsGS);

            save.SaveTurn();
            Gamestate fromFile = new Gamestate(g, save.OpenFile(5, ""));

            Assert.Equal(withItemsGS.g.dungeon.player.location.id, fromFile.g.dungeon.player.location.id);
            Assert.Equal(withItemsGS.BagToString(g.dungeon.player.bag), fromFile.BagToString(g.dungeon.player.bag));

            Assert.Equal(withItemsGS.g.dungeon.turn, fromFile.g.dungeon.turn);
        }
Пример #2
0
 public void BagToStringWorks()
 {
     Assert.Equal(contentOfBag,
                  gs.BagToString(bag));
 }