Exemplo n.º 1
0
        public void AddGameReplayTest()
        {
            List <int> ids = new List <int>();

            ids.Add(1);
            List <int> ids2 = new List <int>();

            ids.Add(2);
            GameReplay gr1 = new GameReplay(1, 1);

            Assert.IsFalse(_testRM.AddGameReplay(gr1, ids));  //same room&game
            Assert.IsFalse(_testRM.AddGameReplay(gr1, ids2)); //same room&game
            GameReplay gr2 = new GameReplay(1, 2);

            Assert.IsTrue(_testRM.AddGameReplay(gr2, ids)); //diffrent game same room
            GameReplay gr3 = new GameReplay(2, 1);

            Assert.IsTrue(_testRM.AddGameReplay(gr3, ids)); //diffrent room same game number
        }
Exemplo n.º 2
0
        public void Initialize()
        {
            User       user1 = new User(1, "test1", "mo", "1234", 0, 5000, "*****@*****.**");
            List <int> ids   = new List <int>();

            ids.Add(1);
            _testRM     = new ReplayManager();
            _testGR     = new GameReplay(1, 1);
            _testAction = new CallAction(new Player(user1, 1000, 1),
                                         new Card(Suits.Hearts, 1), new Card(Suits.Hearts, 2), 10);
            _testGR.AddAction(_testAction);
            _testRM.AddGameReplay(_testGR, ids);
        }