Пример #1
0
        public void TestDiscardCard()
        {
            RPCHandler handler = new RPCHandler();

            SecretHitlerGame game = new SecretHitlerGame(handler);

            var connections = new uint[] { 0, 1, 2 };
            var names       = new string[] { "0", "1", "2" };

            game.Init();
            game.OnStart(connections, names);
            game.OnTick();
            Assert.AreEqual(game.President, 0);
            Assert.AreEqual(game.Cancellor, -1);

            TestHelper.WrapAction(0, game.SelectCancellor, 1);

            Assert.AreEqual(game.President, 0);
            Assert.AreEqual(game.Cancellor, 1);

            TestHelper.WrapAction(0, game.Vote, true);
            TestHelper.WrapAction(1, game.Vote, true);

            Assert.AreEqual(game.President, 0);
            Assert.AreEqual(game.Cancellor, 1);
        }
Пример #2
0
        public SecretHitlerGame GetStartState()
        {
            RPCHandler handler = new RPCHandler();

            SecretHitlerGame game = new SecretHitlerGame(handler);

            game.Init();
            game.OnStart(connections, names);
            game.OnTick();

            return(game);
        }