Esempio n. 1
0
        public void TestFact()
        {
            RaceFactory rf = RaceFactory.getRaceFactory();

            Assert.IsNotNull(rf);
            Race jordy = rf.getRace("human");
            Race willy = rf.getRace("orc");

            PlayerFactory pf = PlayerFactory.getPlayerFactory();
            Player        p1 = pf.createPlayer(jordy, "francois", null);

            Assert.AreEqual(p1.name, "francois");
            Player p2 = pf.createPlayer(willy, "aurelien", null);

            Assert.AreEqual(p2.name, "aurelien");

            Assert.AreEqual(p1.race.name, jordy.name);
            Assert.AreEqual(p2.race.name, willy.name);

            History h = HistoryFactory.getHistoryFactory().createHistory();

            Assert.IsNotNull(h);

            GameStateFactory gsf = GameStateFactory.getStateFactory();
            GameState        gs  = gsf.createGameState();

            h.set(gs);
            h.save();

            Assert.AreEqual(h.pop(), gs);
        }